-1

I want to use this code from github: https://github.com/jesperborgstrup/buzzingandroid/blob/master/src/com/buzzingandroid/tools/PDFTools.java

I want to open pdf from my website. For example: http://www.adobe.com/enterprise/accessibility/pdfs/acro6_pg_ue.pdf

How can I call this method from this class? Please explain me it like a dummy. I am beginner.

Is this correct? PDFTools.showPDFUrl(pdf, http://www.adobe.com/enterprise/accessibility/pdfs/acro6_pg_ue.pdf);

2 Answers2

0

you need to pass the context and url of the pdf file to the method

PDFTools.showPDFUrl(context, pdfUrl);
Jiju Induchoodan
  • 4,236
  • 1
  • 22
  • 24
  • Is this correct? `PDFTools.showPDFUrl(pdf, http://www.adobe.com/enterprise/accessibility/pdfs/acro6_pg_ue.pdf);` – user3766808 Jun 23 '14 at 09:29
  • i dont know how to write it correct. can you write me some example? – user3766808 Jun 23 '14 at 09:34
  • what is context? I dont know what is it... what I should write there – user3766808 Jun 23 '14 at 09:34
  • you are in an activity class right? suppose the activity class name is Main.java, then you can pass Main.this as first parameter – Jiju Induchoodan Jun 23 '14 at 09:38
  • I created sample app in Android studio with Master/Detail Flow and in one detail i want to show pdf... so I am in ItemDetailFragment class. I dont know if it is activity class. But when I write Main.java it shows me only that cannot resolve symbol... same with the name of class – user3766808 Jun 23 '14 at 09:42
  • i think you are in fragment class. just use getActivity() over there – Jiju Induchoodan Jun 23 '14 at 09:47
0
String pdf = "http://www.xyzwebsite.com/yourfile.pdf"; //YOUR URL TO PDF
String googleDocsUrl = "http://docs.google.com/viewer?url="+ pdfurl;
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setDataAndType(Uri.parse(googleDocsUrl ), "text/html");
startActivity(intent);

Add this permission to manifest file

<uses-permission android:name="android.permission.INTERNET" >

For more Follw This

Community
  • 1
  • 1
Roadies
  • 3,309
  • 2
  • 30
  • 46