Thursday, 19 July 2012

Android Pdf Reader


This example shows you how to open a pdf file from your activity.
Algorithm:
1.) Create a new project by File-> New -> Android Project name it PDFReader.
2.) You will see some default code into your main.xml and android manifest file.
3.) Download and install any adobe reader application from android market.
4.) Write following into main.xml file:

android:orientation="vertical" android:layout_width="fill_parent"
android:layout_height="fill_parent">
android:layout_height="wrap_content" android:text="PDFReader" />

5.) Copy any pdf file onto your sdcard.
6.) Make sure to change the name and path of your pdf file in PDFReaderActivity class. In this example I have used “/sdcard/sample.pdf” . You can change the name of your pdf instead of sample.pdf.
7.) Run for output.


Screen Shots: 



Here is Source Code: Download From Here

3 comments:

  1. is it possible to open pdf file without using intent, in built pdf reader and open in our custom view.?

    ReplyDelete