You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@pdfbox.apache.org by ta...@insb.uscourts.gov on 2009/03/24 05:51:02 UTC
getFonts returns an empty Collection when fonts exists
I have a PDF that shows fonts when pressing Ctrl+D from Adobe or running
pdffonts. Below is the output from pdffonts:
name type emb sub uni object
ID
------------------------------------ ----------------- --- --- ---
---------
Error: Unknown character collection 'PDFXC30-Indentity0'
Verdana-Bold TrueType no no no 6
0
Verdana TrueType no no no 8
0
Arial-BoldMT TrueType no no no 10
0
OVQEVK+Wingdings-Regular CID TrueType yes yes no 13
0
ArialMT TrueType no no no 15
0
Error: Unknown character collection 'PDFXC30-Indentity0'
Error: Unknown character collection 'PDFXC30-Indentity0'
Error: Unknown character collection 'PDFXC30-Indentity0'
Verdana-Italic TrueType no no no 32
0
In a Java program using PDFBox, the following line is used to obtain a
Collection of fonts:
loLoop2 = loPdfPage.findResources().getFonts().values().iterator();
For some reason, the Collection is always empty for all pages in the PDF
file. Is there something that I am doing wrong? The above line works on
other PDFs. To make sure that the Collection is empty, I added the
following code:
if (loPdfPage.findResources().getFonts().isEmpty())
System.out.println("isEmpty");
The program prints "isEmpty" for every page.
Thanks for your help!
Tim