Short answer:
I do not know of a single (free) tool that can "just print" the page label for each page.
In addition, you cannot bypass compressed extension objects and object streams using a tool like qpdf or one with equivalent capabilities.
Long answer:
There is no such tool, because this is the only thing you can rely on when it comes to page labels. These are the following:
- Each PDF must contain a root object.
- This root object must be
/Type /Catalog . - The document trailer will show where to find the object using the
/Root switch, followed by a link to the indirect object number. - IF in the PDF document non-standard page labels are used, then the root object of the document must have an entry named
/PageLabels .
Here it becomes relatively light. Because the object to which the /PageLabels key belongs can be contained in the stream of the compressed object. This means that you have to expand this stream of objects.
If you really manage to get the description of page labels as ASCII, you will find that this is not an easily sorted flat list (for example, dictionary ): it is a number tree.
I will not go into details of these difficulties, because a very long article will be required to describe all the possible options. You better read it right in the official ISO specification .
But instead I will give you an example in PDF ASCII format:
213 0 obj << /Type /Catalog /PageLabels << /Nums [ 0 << % start labeling from page no. 1 /S /r % label with lowercase roman numbers >> 7 << % start new labeling from page no. 8 /S /D % label with standard decimal numbers >> 11 << % start labeling page no. 12 /S /D % label with decimal numbers... /P (ABCD-) % ...but using label prefix 'ABCD-'... /St 3 % ...followed by '3' as the start decimal. >> ] >> %%........................... %%...more root object keys... %%........................... >> endobj
In the above example, page numbers 1, 2, 3, ... (last) will be indicated as follows:
i ii iii iv v vi 1 2 3 4 ABCD-3 ABCD-4 ABCD-5 ABCD-6 ...and so on until last page...
As you can see, the PDF method of marking pages (displaying page numbers on page names) is not completely intuitive. You can only understand this by looking at the PDF specification.
Kurt pfeifle
source share