Android: Exception usin iText -
i trying read pdf using itext. below code snippet getting exception "not found file or resource":
public void readfrompdf(){ string content =""; pdfreader reader = null; try { //string filename string path .pdf file, example resources/pdfs/preface.pdf reader = new pdfreader("c:\\test\\demo.pdf"); } catch (ioexception e) { // todo auto-generated catch block e.printstacktrace(); } int numberofpages = reader.getnumberofpages(); numberofpages = numberofpages + 1; (int page = 1; page < numberofpages; page++){ try { string content1page = pdftextextractor.gettextfrompage(reader, page); content = content + content1page; } catch (ioexception e) { // todo auto-generated catch block e.printstacktrace(); } }
could please figure out whats going wrong?
i had same problem - nobody gave me answer & prof didn't find bug.. soo.. i'm using pdfbox apache http://pdfbox.apache.org it's quite simple read pdfs.
Comments
Post a Comment