You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@pdfbox.apache.org by Federico Rodolfo Rieckhof <fe...@googlemail.com> on 2011/08/17 18:29:49 UTC

Problem with Font extraction

Hello,
I am new to PDFBox i want to extract the fonts out of the pdf i
downloaded from a database, so i used in my main

 1 PDDocument pddDocument=PDDocument.load("docs/Kolk, Perego (2010)
assurance.pdf");
 2 PDFTextStripper textStripper=new PDFTextStripper();
 3 System.out.println(textStripper.getText(pddDocument));
 4 Map<Strtring,PDFont> mapFont =  textStripper.getFonts();
 5 pddDocument.close();

until line 3 everything goes well but in line 4 i get the following exception:

java.util.EmptyStackException
    at java.util.Stack.peek(Unknown Source)
    at org.apache.pdfbox.util.PDFStreamEngine.getFonts(PDFStreamEngine.java:596)
    at Main2.main(Main2.java:96)

I have similar problem when wanting to extract something more than
text. Why is this ?
I am using PDFBox Version 1.6 and Java 6 in Windows 7. Could somebody
please help me.

Regards
Rodolfo