Advanced is the fourth Document Properties tab that we’ve recreated with APDFL. Previously we’ve covered recreating the Tabs for Fonts, Description, and Initial View. To some extent, The Advanced tab is a continuation of the Initial View tab, but with more arcane options. And because these options are less common, there are fewer helper functions for extracting this information.
The Base URL is a way of specifying the document’s home address, and allows for relative URI actions in the document to be fully qualified with the base URI. It’s a PDF 1.1 feature, but like most of the document properties on this tab, it is fairly rarely used. Nonetheless, the code to extract it is:
The Search Index is an undocumented Adobe feature for an external index file. It is largely obsolete now that computers are fast enough to search PDFs without requiring prebuilt index files. The following code was arrived at with a bit of reverse engineering rather than official documentation.
Trapped is an indicator that the line art has been prepared for production printing. It’s not an obsolete feature, but it’s only of concern for professional printing. This is the only Advanced tab feature for which there is a dedicated function.
Most of the rest of the Print Dialog portion of the Advanced tab have properties, also stored in the ViewerPreferences dictionary, and while slightly more complicated than the boolean checkboxes in extracted from the Initial View tab, they aren’t that complicated to figure out. The one exception is the Print Page Range, which is also described in the PDF Reference in Table 8.1, section 8.1, but the description for the PrintPageRange array could stand to be a bit clearer.
The Binding setting is the last of the ViewerPreferences; Direction, specifically. The PDF Reference makes the Direction entry sound like it indicates a bi-directional text reading order; which, I guess, might have some bearing as to where the binding would be for a document.
The last property on the Advanced tab is Language and while I could have done more to imitate the drop-down that Acrobat provides, the list that Acrobat provides isn’t complete, and if the Lang entry is unrecognized, then it is shown as is. So for the purposes of this exercise, we are just going to show the Lang value as is.
The full code is available here.