0

I am trying to show a normal PDF document on an Android device. And I m pretty comfortable in doing so.

The actual problem which I am facing is, 1. PDF docs are saved in binary format in the Backend 2. When I fetch those from my Android App, I get binary content 3. I want to convert this binary format/content into a format which I can show as PDF document within my Android App

Is their any way to achieve this?

Plz help... Thanks in advance...

Dharmaraj Patil
  • 116
  • 1
  • 6
  • 1
    PDFs *are* binary files. http://en.wikipedia.org/wiki/Binary_file – CommonsWare May 09 '12 at 12:05
  • 1
    @Adrian Monk, when the question was/is not answered correctly it can not be marked as an Answer. If you read the question posted by Dharmaraj Patil carefully, no one has answer his question. The question is how to display the PDF which is in a Binary format stored in variable in an Android device. The PDF is being received from a web service or some other source in binary format and not a physical file which was generated by a application server. I say this because now I am in a same boat... :) – Vincy Feb 26 '13 at 12:44
  • @Vincy: Thanks... The actual problem is to show PDF's within android app and not in any other third party PDF readers. Please let me know if you find any solution. – Dharmaraj Patil Mar 25 '13 at 06:35
  • Also for the one who are still struggling to do the same... Please find the below link to create a custom PDF Reader which can be integrated as an activity within the android app; http://stackoverflow.com/questions/11152956/example-of-code-to-implement-a-pdf-reader/11153601#11153601 Cheers! Now PDF's can be read/shown as a part of your application.... :-P – Dharmaraj Patil Mar 25 '13 at 06:35

1 Answers1

-1

You can try this

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);
  }
}

As answered Shylendra Madda here

Community
  • 1
  • 1
DeniSHow
  • 1,394
  • 1
  • 18
  • 30