Tuesday, May 10, 2016

PSPDFKit Framework Size


The PSPDFKit SDK covers most of the PDF specification, which contains thousands of pages, and thus is quite complex. PSPDFKit includes a complete PDF renderer, cryptography and many UI components. This results in a lot of code and thus a sizable binary, although there are certain factors that make it appear larger than it actually is. We’re working hard to ensure the framework size stays as low as possible.


The PDF specification requires us to embed a sizeable list of character maps that add a few megabytes per architecture to ensure that text in PDF form can be converted to Unicode to make search and text selection work as expected.


PDF has been around since 1993 and evolved a lot since then. This also means that there is a lot of legacy baggage in the specification - and one of the main promises of PDF is that even your 20-year old documents will still render as they were, pixel-perfect. The specification, currently at version 1.7, has 756 pages.


Next to the official specification, there’s also “real world” PDF which often has bugs based on misunderstandings or bugs in creation software that need specific workarounds and hacks. Adobe Acrobat is very forgiving in terms of invalid references, duplicate entries, typos and allows various drawing command variations that are nowhere documented - these are things that have to be found out via trial and error and also add to the complexity of a rendering engine.

Comments RSS · Twitter

Leave a Comment