jblough / Android-Pdf-Viewer-Library

DEPRECATED - Pdf Viewer library for Android
657 stars 329 forks source link

How to Open remote PDF ? #34

Closed BYogesh closed 10 years ago

BYogesh commented 10 years ago

Hello, I am getting a url of the location where the PDF is stored. I want to open the pdf with the pdfviewer. Can I get the guideline to open it as currently I am saving the url in string and then I am passing the string as the path of the pdf to the Activity through the intent

final Intent readPdf = new Intent(getApplicationContext(), PdfViewerActivity.class);
readPdf.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
readPdf.putExtra(PdfViewerActivity.EXTRA_PDFFILENAME, path);
startActivity(readPdf);

It shows me PDF does not exists but the pdf is available. please guide.

ndorigatti commented 10 years ago

You have to have the file in the device and locally accessible in order to use the library since in order to open the file it's using a RandomAccessFile that needs the file and not a stream. So you have to download file and then open it

2014-08-19 12:22 GMT+02:00 BYogesh notifications@github.com:

Hello, I am getting a url of the location where the PDF is stored. I want to open the pdf with the pdfviewer. Can I get the guideline to open it as currently I am saving the url in string and then I am passing the string as the path of the pdf to the Activity through the intent

final Intent readPdf = new Intent(getApplicationContext(), PdfViewerActivity.class); readPdf.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); readPdf.putExtra(PdfViewerActivity.EXTRA_PDFFILENAME, path); startActivity(readPdf);

It shows me PDF does not exists but the pdf is available. please guide.

— Reply to this email directly or view it on GitHub https://github.com/jblough/Android-Pdf-Viewer-Library/issues/34.

BYogesh commented 10 years ago

@ndorigatti Thanks brother ...