1

I need to open PDF for reading,rendering & annotation in my own application W/o using any third party tool or library like MuPDF & APV Viewer,in webview etc.

Is there any way to open PDF in my app in android without using above.

Please help me !!!!

Thanks

Beyond Key
  • 21
  • 2
  • 3

3 Answers3

1

There is no way to read pdf without any library, you can use PDFViewer.jar library to read pdf into your application, use below SO link's answer for read PDF using PDFViewer.jar

Read PDF using PDFViewer.jar

Download Jar file from below link.

http://www.filecrop.com/pdf-viewer.jar.html

Community
  • 1
  • 1
Dipak Keshariya
  • 22,193
  • 18
  • 76
  • 128
  • 1
    Thanks for your reply !!!! I want to add annotation on PDF like highlight,search text etc in my app. PDFViewer convert PDF into images so how can I achieve this target using this lib ?? – Beyond Key Aug 23 '12 at 13:44
0

refer qtuestion

Render a PDF file using Java on Android

it will show you the best methods available to open a pdf in android i dont think there is a way to open without using either of these things mentioned above

  public class MyPdfViewActivity extends Activity {

    @Override
 protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
WebView mWebView=new WebView(MyPdfViewActivity.this);
mWebView.getSettings().setJavaScriptEnabled(true);
mWebView.getSettings().setPluginsEnabled(true);
mWebView.loadUrl("https://docs.google.com/gview?embedded=true&url="+LinkTo);
setContentView(mWebView);
 }
 }

best method to open without an api or installed prog

Community
  • 1
  • 1
Athul Harikumar
  • 2,501
  • 18
  • 16
0

Posting this if it could help someone some day, In order to view pdf files in android you can make use of the pdf.js which requires you to add the web related files in assets folder which includes the js files in the index.html and call the index.html by passing the url of the pdf file as query parameter and load it in the webview.

Pros: User need not navigate away from the webview You can reuse the same to display PDFs which are hosted in server or available withing the application also you can view pdf which require to login using cookies. Cons: There will be a slight increase in app size.