1

Does android provide any built it control like video view or image view to display pdf ebook?

More specifically I want to open a pdf ebook in android with following controls on the screen.

  1. zooming controls
  2. turn over functionality/swipe to change page.

What is the suitable way to achieve this?

UMAR-MOBITSOLUTIONS
  • 77,236
  • 95
  • 209
  • 278

1 Answers1

2

Android does not provide a default PDF reader. I believe some phones come with a pre-installed application for reading PDFs, but you cannot rely on this fact for all devices. The best you can do for now is choose to open the user's default PDF reader (if they have one installed).

Use an intent to open up the user's default PDF app (untested, should be something like this):

Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setDataAndType(pathToPDF, "application/pdf");
startActivity(intent)
Ben Siver
  • 2,758
  • 1
  • 25
  • 42
  • this code segment only works if you have downloaded pdf in your sd card, i have tried to open pdf url in webview it does not open it. could you please put some light on it? – UMAR-MOBITSOLUTIONS Jul 19 '11 at 15:32
  • You did not specify the PDF was only accessible via the web. This question should provide you with an answer: http://stackoverflow.com/questions/3831019/ – Ben Siver Jul 19 '11 at 15:41