package com.qoppa.releasetest; import android.app.Activity; import android.os.Bundle; import android.os.Environment; import android.util.Log; import com.qoppa.android.pdfProcess.PDFDocument; import com.qoppa.android.pdfViewer.fonts.StandardFontTF; import java.io.File; /** * This Activity extracts text from a PDF document. */ public class ExtractTextActivity extends Activity { public void onCreate(Bundle saveInstBundle) { super.onCreate(saveInstBundle); try { //this static method allows the sdk to access font assets, //it must be set prior to utilizing libraries StandardFontTF.mAssetMgr = getAssets(); //create the document you want to extract text from File file = new File(Environment.getExternalStorageDirectory(), "Documents/mydoc.pdf"); PDFDocument pdf = new PDFDocument(file.getAbsolutePath(), null); // extract the text String text = pdf.getText(); // Do something with the text... } catch(Exception e) { Log.e("error", Log.getStackTraceString(e)); } } }