pdf - How to add PDFBox to an Android project or suggest alternative -



pdf - How to add PDFBox to an Android project or suggest alternative -

i'm attempting open existing pdf file , add together page pdf document within android application. on added page, need add together text , image.

i wanting give pdfbox try. other solutions such itextpdf aren't suitable our company because of licencing terms/price.

i have library project main code base, , total , lite projects reference library project.

i have downloaded jar http://pdfbox.apache.org/download.html , copied library projects lib folder , added pdfbox-app-1.6.0.jar file java build path libraries.

i able import librarys eg import org.apache.pdfbox.pdmodel.pddocument; , compile projects. when run application crashes on pddocument document = new pddocument(); next error.

e/androidruntime(24451): java.lang.noclassdeffounderror: org.apache.pdfbox.pdmodel.pddocument

i read somewhere version 1.5 of pdfbox onwards didn't work android tried downloading pdfbox-app-1.4.0.jar file got same issue. added library build path in total , lite projects got same error or eclipse kept crashing out of memory error.

can tell me doing wrong? have downloaded wrong file? have imported correctly?

thanks,

pdfbox uses java awt , swing, non ui tasks, i've tried remove references there lot of files, , removing much stuff

i've tested pdfjet http://pdfjet.com/os/edition.html it's bsd licensed (plus commercial version more features), sample code (ripped example_03.java) able convert jpeg pdf

fileoutputstream fos = null; seek { fos = new fileoutputstream("/sdcard/sample.pdf"); pdf pdf = new pdf(fos); inputstream f = getapplicationcontext().getassets().open("img0.jpg"); image image = new image(pdf, f, imagetype.jpeg); page page = new page(pdf, a4.portrait); image.setposition(0, 0); image.drawon(page); pdf.flush(); fos.close(); } grab (exception e) { e.printstacktrace(); }

i found link here http://java-source.net/open-source/pdf-libraries

android pdf pdfbox

Comments

Popular posts from this blog

delphi - blogger via idHTTP : error 400 bad request -

c++ - compiler errors when initializing EXPECT_CALL with function which has program_options::variables_map as parameter -

How do I check if an insert was successful with MySQLdb in Python? -