Why people are not recommending display PDF using PdfRenderer?

620 Views Asked by At

Since last month I have been searching for best way to show pdf into android app. I was always getting help of third party library. No one has talked about Android also providing same thing via PdfRenderer. If we have native support, why should we use library?

Please correct me, Why on search to show pdf file into Android app, I am always getting link of libs?

3

There are 3 best solutions below

0
iPDFdev On BEST ANSWER

The PdfRenderer class simply converts a PDF page to image. If you want to display some page thumbnails it is just fine, but if need a PDF viewer with support for document navigation and zooming then implementing it on top of the PdfRenderer becomes a very complex task.

3
Milap Pancholi On

Just pass URI of your pdf file this will help you to display a pdf in a OS Supported Pdf viewer

Intent browserIntent = new Intent(Intent.ACTION_VIEW, Uri.parse(Url));
startActivity(browserIntent);
0
DKIT On

PdfRenderer was added in API Level 21 - so if you want to support earlier models of the Android OS, you have to use something else. That's the only reason I can think of. I guess it depends on how complicated your needs are.