Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix not detecting Type 0 (composite) fonts
Previously the function to gather used fonts would only walk certain parts of the PDF object tree. This worked for PDFs which had TrueType fonts embedded, since the tree looks like this: (parents) BaseFont: AAABQG+ArialMT ... FontDescriptor: FontFile2: ... FontName: AAABQG+ArialMT ... Some PDFs have composite fonts, which look like this: (parents) BaseFont: MUFUZY+ArialMT ... DescendantFonts: # AN ARRAY! - BaseFont: MUFUZY+ArialMT FontDescriptor: FontFile2: ... FontName: MUFUZY+ArialMT ... In addition, the FontDescriptor is actually an indirect reference, which means it doesn't (directly) have a "keys" attribute. This fixes the false positives for detecting unembedded fonts, by adding support to walk the tree for arrays and indirect objects. Note, I found this article helpful [1]. [1]: https://www.prepressure.com/pdf/basics/fonts
- Loading branch information