PdfBox-Android icon indicating copy to clipboard operation
PdfBox-Android copied to clipboard

Build configuration

Open jyosh opened this issue 12 years ago • 9 comments

How do I build the source? Is there maven or any other configuration available? Thanks,

jyosh avatar Nov 18 '14 12:11 jyosh

For now you just need to compile the source with the jars in /libs added to your buildpath. If you aren't making any changes to the source, there's already a compiled jar in project folder

TomRoush avatar Nov 19 '14 04:11 TomRoush

I'm using the latest jar to extract text from a simple pdf file with a single line but it neither returns the call nor throws any exception. I wanted to debug the PDFTextStripper getText method to know the problem. Below is my code for that

InputStream template = assetManager.open("in.pdf"); PDDocument pdfDoc = PDDocument.load(template); PDFTextStripper stripper = new PDFTextStripper(); String txt = stripper.getText(pdfDoc);

even I wait for long it stucks at getText call. I set 1GB memory for the virtual device.

jyosh avatar Nov 19 '14 05:11 jyosh

What font and encoding do you have in this pdf?

TomRoush avatar Nov 19 '14 05:11 TomRoush

I created the pdf using winword font - times new roman encoding - ansi

jyosh avatar Nov 19 '14 05:11 jyosh

This time after more than 30 minutes wait it returned the single line of text. Wondering why it took so long! Previously I tried with calibri embedded font.

jyosh avatar Nov 19 '14 06:11 jyosh

Well that's something I guess. If you can, try it on a phone. Depending on the computer and emulator settings, it may be really slow. I see that I forgot to commit the latest jar, it will be up later today. It may help with your issue.

TomRoush avatar Nov 19 '14 16:11 TomRoush

I too thought in that line emulator env is one cause of extra time taking. I'll update once test it on a phone.

And, congratulation for your wonderful job of porting the pdfbox to android, it is really working!

jyosh avatar Nov 20 '14 04:11 jyosh

on a 2gb ram phone it takes only 3 minutes to extract text from a 100 pages pdf

jyosh avatar Dec 19 '14 17:12 jyosh

That's about the expected performance.

TomRoush avatar Dec 23 '14 06:12 TomRoush