How to check that all used fonts are embedded in PDF with Java iText?

Look at the ListUsedFonts example from iText in Action.

Up vote 1 down vote favorite 1 share g+ share fb share tw.

I have some existing PDF documents, and I'd like to validate that they use only embedded fonts. This would require checking that no PDF standard fonts are used and other used fonts are embedded in the file. Java pdf fonts itext link|improve this question edited Jan 10 '11 at 13:14 asked Jan 10 '11 at 11:05Juha Syrjälä6,43842570 81% accept rate.

Look at the ListUsedFonts example from iText in Action. itextpdf.com/examples/iia.php?id=287 Looks like this will print out the fonts used in a pdf and if they are embedded.

For some reason that snippet fails to find this font: embedded Type 1 CFF (CID) font AllAndNone – Juha Syrjälä Jan 20 '11 at 7:39 The snippet is wrong in one case: a Font's FontDescriptor and FontFile nodes may defined in also in Font's DescendantFont node. – Juha Syrjälä Jan 20 '11 at 13:11.

When you create Chunk, you declare what font you use. Create BaseFont from the font you want to use and declare is as BaseFont.EMBEDDED. Note that when you not set option subset to true, the whole font will be embedded.

Be aware that embedding font might violate authorship rights.

I am not creating a PDF document, I already have a PDF that I want to check. – Juha Syrjälä Jan 10 '11 at 13:12.

I don't think this is an "iText" use case. Use either PDFBox or jPod. These implement the PDF model and as such enable you to: open the document recurse from the document root down the object tree check if this is a font object check if the font file is available A check if only embedded fonts are used is by far more complex (this is , fonts that are not embedded but not used are fine).

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions