Updating

This PlugPDF SDK Andorid Developer Guide is temporarily unavailable while we are updating contents.

Please check back shortly!

PlugPDF SDK Android Developer Guide

An Android PDF library into your app, in 3 steps!


1. Import the PlugPDF SDK for Android


Open the Android Studio welcome dialog and click Open an existing Android Studio project in the Quick Start section. Select the PlugPDF_Android folder in the Open File or Project dialog.

Please read this how-to for further information.

2. Initialize the PDF library


Copy the code below and paste it into the onCreate method of your MainActivity.java, as explained in the video at 05:50

@Override
protected void onCreate(Bundle savedInstanceState) {
 super.onCreate(savedInstanceState);
  setContentView(R.layout.activity_main);
  try {
   // Initialize PlugPDF with a license key.
   PlugPDF.init(getApplicationContext(),
    "D9B22DA93HF9GH59ED34BC3F6C227AG878DGE239E478B49B8CH7FBF5"); 
  } catch (InvalidLicense ex) {
  Log.e("PlugPDF", "error ", ex);
  // Handle invalid license exceptions.
 }
}

3. Instantiate the PDF Viewer


protected void open() {
 String path = "";
 SimpleDocumentReader viewer = SimpleReaderFactory.createSimpleViewer(this, mViewerListener);
 viewer.openFile(path, "");
 viewer.enableAnnotationMenu(true);
 viewer.setTitle("Sample");
}

Read More