PDF files have a very useful feature known as XForms, which are sub-procedures. This makes it very easy to reuse code and produce smaller files. XForms can be thought of as fragments of PDF pages in their own right, with their own images and fonts and other resources, which can then be drawn onto the main page. In general they also inherit data from the main page. So if the XForm makes a call to Font TT1, it sees if it is defined in the XForm and looks in its parent if not.
However, here is an interesting XForm. It loads ant XForm called xi0. And guess what xio does? It loads a form called xio… There is no local definition of xi0 – so we default back to the main definition of xio (and round we go).
Adobe reports an error in this file and it is reasonably easy to add a check to stop this, but it is very annoying…
The PDF file format is a very powerful format but with power comes responsibility.
This article is part of a series on the more ‘unusual’ PDF files we come across while developing our PDF library. Click here for the full list.
Latest posts by Mark Stephens (see all)
- How we are improving our code quality with IDEA in 2018 - March 7, 2018
- How we are improving our code quality with NetBeans in 2018 - March 1, 2018
- 3 ways that the European Union is changing the way Companies write software in 2018 - January 31, 2018
- IDRsolutions product range update for 2018 - January 22, 2018
- 4 ways Companies can make remote working successful - December 21, 2017