How to load a .pdf or a .doc file in android - android

I want to show a pdf (preferably) or a word document in my app; like a privacy notice screen. Many applications have it, so it should be possible. i tried loading a simple text file as a start but doesn't provide formatting, fonts or trade mark symbols. I've gone through a few posts but I couldn't apply it to my app. Could anyone tell me how is it done? Could I store the file somewhere in res folder and provide a path to open it through my code? I looked into the following link but I'm not sure if that's the right approach in my case android: open a pdf from my app using the built in pdf viewer.

Android does not support opening PDF and DOC files natively. You'd have to make your own implementation.
Like t0mm13b said, you should consider using HTML (+ CSS) instead and use a WebView.

Related

How to open documents located in Local Storage in android using WebView?

I have a doc/ppt/xls file located in my sd card. I want to open it without any third party app (i.e within my app itself) using webview. Though I am able to open documents by embedding it in google docs url like -
http://docs.google.com/gview?embedded=true&url=[filelinkHere]
But how to open a file located in internal or external storage in webview ?
Also, Suggest me any third party ALL-IN-ONE library for android to view all types of documents. I have tried ASPOS but it has few unresolved bugs and APACHE-POI is difficult to use.
I had the same issue few days ago .
i found Android PdfViewer best to view PDF files and Android PdfMyXml best to create pdf files in android.
For working with Word and Excel as a most reliable answer I suggest you to take a look at OliveDocLibrary .
If your documents are in cloud so there is an alternative way to display docx,pptx,pdf and such formats with a combination of Webview and googleDoc.
You might find other possible solutions in server-side machines or maybe a creative way!
Hope it help
You can integrate some library project to your project with which you can open the pdf file inside your app.
Reference :
https://github.com/tekinarslan/AndroidPdfViewer
https://github.com/JoanZapata/android-pdfview

Android code using iText to edit an PDF and save it as different file name

I have an PDF file and there are certain inputs that ought to be filled in the same. There are two approaches to this. Either, I create an entirely new screen that looks like the PDF file and get the user inputs and parse it to the iText library to create a PDF file or open the template PDF and fill in the contents through the android screen and save it in different file.
I am trying to concentrate on the second option. Here, I will have to open the existing template PDF and enable the user to enter the input items. I will also have to allow the users to scribble in certain areas. Is this feasible? I have done some research and am not sure, if all these are possible using iText.
Please can someone help me?

Read the contents of the PDF file onto a webView

In my project I have to load the contents of a PDF located in the assets folder onto a WebView.Can It be achieved directly just by reading the contents onto a WebView.. I googled a lot and I found that i need to use third party PDF readers to achieve the same?
If so, Plz give me the links of the source of the PDF reader of GITHUB. Am not able to find it..
If you load pdf inside the webview, unicode text type or images wont be visible. So you want
to go for OCR tool.
Use set of libraries and sdk
This might help you
http://www.qoppa.com/android/pdfsdk/
http://code.google.com/p/droidreader/
mupdf is the best library in terms of performance and all i have found till now, you can also use it in your application.
But it needs knowledge of ndk.
Click here for more description

Embed PPT to HTML (for a webview in Android)

Does anyone know a way to embed a PPT file (powerpoint) into a HTML?
I found solutions like embed through an iframe by Office Web App and/or Google Docs. I tried them and works fine into the HTML, but in my case I need to have the PPT file into a personal server.
Other options I found are like Embedit.in, a flash embed that shows th PPT (no convert the PPT to SWF (flash format)).
But, I still looking for a way for show a PPT file saved in a personal server into a HTML, any idea? any webservice for this problem?
Before PowePoint 2010 you could save the ppt to html using PowerPoint API.
Did you checked also for api vendors? It's a common issue probably there api to do that.
Suggestion...
Convert the ppt to pdf and use the code generator # http://pdfobject.com/generator.php .
Use standard (not java) .
There in one small mistake in the code they generate Remove the hashtag # at the end of the url.

Content viewer Android

I'm trying to create an activity to show information about the monuments. What I thought is to create HTML files and then display them with a WebView. The problem is that I also need to export these contents on sdcard in some type of readable format (preferably pdf but I read some things and it seems very difficult and then I tried several solutions without success). How can I do this? Should I start from another type of format different from HTML?
Advise me a path to follow ... I do not know what else to try.
Thanks in advance. :)
Michele
There are multiple options. I would suggest go the PDF way.
If you have control over the contents, then the best way would be to create PDFs and you can then send a intent to open the PDF. If there are multiple PDF viewers available, then the intent will give an option for the user to select the viewer. If there is only one viewer available, the PDF will be opened in the viewer. If there are no available options, you can then send them to Google Play (Android Market) to download a PDF viewer and then view the PDF.

Categories

Resources