I try to use pdfbox lib in my android application but I get
java.lang.NoClassDefFoundError: org.pdfbox.pdmodel.PDDocument
this mistake. I am developing a commercial application, I can not use another Lib like itext. So my question is whether we can use PDfBox in android.
here is my code: -
PDFParser parser = null; String parsedText = null; PDFTextStripper pdfStripper; PDDocument pdDoc = null; COSDocument cosDoc = null; PDDocumentInformation pdDocInfo; try { f =new File(Environment.getExternalStorageDirectory()+File.separator+"Download"+File.separator+"Services.pdf"); if(f.exists()){ System.out.println("---------exists-----------"); }else{ System.out.println("------NOT----exists----------"); } parser = new PDFParser(new FileInputStream(f)); } catch (Exception e) { System.out.println("Unable to open PDF Parser."); System.out.println("-----------------------error|"+e.toString()); } try { parser.parse(); cosDoc = parser.getDocument(); pdfStripper = new PDFTextStripper(); pdDoc = new PDDocument(cosDoc);
using PDFBox 0.7.3 jar
android pdfbox
Prachi Mar 14 2018-12-12T00: 00Z
source share