Mark Stephens

Mark Stephens has been working with Java and PDF since 1999 and has diversified into HTML5, SVG and JavaFX.

He also enjoys speaking at conferences and has been a Speaker at user groups, Business of Software, Seybold and JavaOne conferences. He has a very dry sense of humor and an MA in Medieval History for which he has not yet found a practical use.

Interesting PDF bugs – an extreme case of recursion

43 sec read

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.

Mark Stephens

Mark Stephens has been working with Java and PDF since 1999 and has diversified into HTML5, SVG and JavaFX.

He also enjoys speaking at conferences and has been a Speaker at user groups, Business of Software, Seybold and JavaOne conferences. He has a very dry sense of humor and an MA in Medieval History for which he has not yet found a practical use.

Pros and Cons of Bitbucket Pipelines

Recently I have been looking at our current test suite looking for ways to improve our own tests. As we use Bitbucket we have...
Kieran France
3 min read

Leave a Reply

Your email address will not be published. Required fields are marked *