Skip to main content
Known Participant
July 10, 2021
Question

Is it possible to determine missing fonts (psname and the font format) in a pdf file

  • July 10, 2021
  • 1 reply
  • 963 views

I am writing a plugin and I cant seem to find a way in sdk to determine if the document has missing fonts

I also looked at the info regarding to the font format for a Font and could not find a way beyond CID fonts

This topic has been closed for replies.

1 reply

RdMaxAuthor
Known Participant
July 10, 2021

So I came across PDFontWasFauxed is this a safe bet to detect missing font?

Legend
July 10, 2021

What specifically and exactly do you mean by a "missing font"? I am not sure this concept actually exists in a PDF. Do you mean the PDF is fine but the font is neither embedded, nor available to the system?

Legend
July 12, 2021

I can create a pdf where while saving a pdf doc, one can unembed fonts

This way we can create a pdf which we open on another machine, will not be properly rendered

 

I am creating a plugin which can detect which exact fonts are missing in the document

I will be able to use the detected data and then activate the fonts from my font inventory

 

Thanks for the interest 🙂

 


Ok, so it is non-embedded fonts you want to detect. I can think of two ways. 

1. Enumerate pages, enumerate all text runs, check PDEFont for embedding flags.

2. Enumerate all font dictionaries in all Resources dictionaries (recursively into Form XObjects etc.), checking the FontFileXXX values in font attribute dictionaries.