This question already has an answer here:
Best way to include pdfs in an app
(1 answer)
Closed 9 years ago.
I am going to write an android app, which will contain a PDF file (included with in the application). My task is, when i click a button , pdf file should open . PDf file is placed in assets/raw (not sure where to place ).
Can any one help on this...
Thanks in advance
You can open pdf via webview and google docs.
You should use
WebView.loadUrl("http://docs.google.com/gview?embedded=true&url=www.site.com/file.pdf");
I would use a PDF Renderer to convert the file to a Bitmap. Otherwise, you would have to use another application to open the file, or the option that Walter gave you. Here is an example using a different library for rendering a PDF using Java.
Related
With BluetoothChat sample from Google sources as the base, what are the steps in implementing a file transfer function using that base code? I am trying to send a pdf or an image file (jpeg, jpg, png) to the other devices.
The chat functionality already works and I'm trying to implement a file transfer.
I can get the Uri and real file path (using PickIt library, ex path: storage/0/emulated/etc/etc) of the file that the user picked from the ACTION_GET_DOCUMENT intent. For the image file, I have found sources. They first convert it to a bitmap then to bytes and vice versa on the receiving device but haven't tried to do that yet. As for the pdf file, how would I implement it? I'm confused and questions similar to mine are mostly 7-10 years ago. Any help is appreciated. TIA!
P.S. I'm still new to Android development and I'm using Java.
This question already has answers here:
How to render a PDF file in Android
(11 answers)
Closed 7 years ago.
I am going to read a pdf file from my sdcard and load it into my android application without starting any pdf reader installed on my android device!
is it possible?
how?
thanks!
Or if you have access to internet, just upload it to Google Drive and view it online.
Just you need a Browser in this case.
The content of the .pdf can be read with read with the iText library for Android http://itextpdf.com/product/itextg But If you want see the content you need a pdf viewer app or integrate one in your app
This question already has answers here:
How to render PDF in Android
(6 answers)
Closed 9 years ago.
i am very new to android development..........i have searched the stack overflow archives but nothing seem to work for me....
i just need an application to read PDFs files in android on button click....
-just PDFs read (no writing or converting or anything)
please if someone can guide me in the right direction and which library to get.......
used itext but its not working.......application crashing on
Document document = new Document();
any help would be appreciated.....thank you
you can read pdf files using WebView like
mWebView.loadUrl("https://docs.google.com/gview?embedded=true&url="+ webUrl);
You must use an implicit intent, put the PDF file path in an URL and launch it with the intent with ACTION_VIEW, it will launch with the default PDF application.
This question already has answers here:
Closed 10 years ago.
Possible Duplicate:
How to read pdf in my android application?
My application will have a link for a pdf file. When user click on a link, pdf file should download to local storage if it is not already present and my application should open that pdf file in a pop-up window and that popup will have close button at top right corner of window. I don't want default/third party pdf reader to display my pdf file.
How I can implement this requirement in my application?
No.Without third party you cant use it. If you force to use it, then images or some unicode
text type wont visible.So you want to go for OCR tool or use set of libraries and sdk for pdf.
Libraries and sdk.
This might help you
http://www.qoppa.com/android/pdfsdk/
http://code.google.com/p/droidreader/
This question already has an answer here:
Closed 10 years ago.
Possible Duplicate:
How to create pdf files on android
I have a program that asks the user for information, then I need to put this information on a document/contract. I think I would like to create a pdf file with that information using itext (other alternate ways would also be appreciated). Although, I found that the itext version is not built (at least the free version) for android. My only solution is to create a server, send this information to a server that creates the pdf and then sends the pdf back to my phone. I have no idea how to do this. Or if anyone knows how to make an itext version for android.
Welcome to stackoverflow. Search your problem well before reaching out.
If you want to do this on the server you can create a simple PHP script that generates the PDF for you.
Just Google for PHP generate PDF and it will give you a lot of links.
If you want to do the pdf generation on the device you can leverage a java library that does it for you. try this stackoverflow link create pdf files on Android