I am trying to get the font colour from PDFBox and I seem to keep throwing an exception. Can someone help? The way I tried to obtain the colour was (page is the PDPage I obtained):
PDResources = page.getResources();
Iterable<COSName> fontNames = resources.getFontNames();
for (COSName fontName:fontNames)
System.out.println("name: " + resources.getFont(fontName).getName() +
"colour: " + resources.getColorSpace(fontName).getName());
This prints out the exception:
org.apache.pdfbox.pdmodel.MissingResourceException: Missing color space: F1
Could someone tell me how to properly get the colour of a font obtained in this manner?