About this topic
This is my first topic about LibreOffice. This topic is about PDF page labeling issue.
1. Attachment
This topic contains attachment that is uploaded separately because the maximum file size to be uploaded to this website is 4MB. The attachment is in PDF format and is written using LibreOffice Writer.
The PDF document attached in this topic explains more about the issue and contains ODT document inside the PDF attachment. I recommend you to scan the PDF file I uploaded before you open it, which can double protect you against malware.
The attached document is licensed under Creative Commons Attribution 4.0 International, which means you are free to copy, redistribute, remix, transform, and build upon the material in any medium or format for any purpose, even commercially, unless your conscience restricts them. You must keep the license and the name of the original author retained and stated, and be sure not to sell it.
https://creativecommons.org/licenses/by/4.0
2. Terminologies
This section describes the terminologies found from the official sources. For the other terminologies, please refer to the attached document.
2.1. What is 'page index'?
Page indexes (or page index) are page numbers that start from the first-most page of a document and the first page index may starts from 0 or 1. The PDF page index is starts from 0 and page index in LibreOffice is starts from 1. It cannot be resetted using anything including page break with page number reset.
2.2. What is 'page label(s)'?
Page labels are special purpose page numbers equivalent to the page numbers written on a document that are used by page navigation tool to navigate to the other page quickly.
3. Issue
Figure 1: Example of the ODT document that when exported to PDF, the page labels are included.
The document contains 6 pages with Roman page number format, page number reset to 1 after page vi (see red text), and 6 pages with Arabic page number format with chapter page without page number written onto the page, as some pages not always contain written page number.
As we can see in this figure, the page labels must be equal to the adjustable page numbers.
The page labels in the PDF document that are inherited from the adjustable page numbers are not included and thus the page numbers in the page navigation tool are always incremental and do not match with the written page numbers. This can be proven using any PDF viewers (in this case Adobe Reader and Mozilla Firefox (desktop)).
For example, we have the ODT document with the adjustable page numbers as follows [i,ii,iii,iv,v,vi,1,2,3,4,5,6,7,8,9,10]. But when we export it to PDF, the page labels of the PDF document are not included and thus the page numbers are [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16] and they will mismatch with the adjustable page numbers.
And the issue must not happen as because I have many page styles with different page number formats and I also made the page number reset using manual page break.
The page labels of the PDF document must be included when exporting document to PDF and must be inherited from the adjustable page numbers from the ODT file.
In this case, I made the ODT document (available in the PDF attachment) with page number formats i, ii, iii, iv…, and 1, 2, 3, 4…
If we export the document to PDF and we open the PDF document using any PDF viewers that are capable of interpreting page labels, the page numbers in the page navigation tool are assigned with incremental page numbers instead of the adjustable page numbers.
If we open the PDF file in the Adobe Reader and we need to go to the written page iii, the Adobe Reader dialog box says “There is no page numbered ‘iii’ in this document.”.
Figure 2: The Adobe Reader dialog box says “There is no page numbered ‘iii’ in this document.”.
4. Suggestions for newer LibreOffice
In the next minor (or major) version of LibreOffice, I suggest the followings:
4.1. The checkbox 'Add page labels' must be made available
The checkbox ‘Add page labels’ must present in the document export dialog, especially in the PDF export dialog, and must be checked automatically if the page number format of one or more page style(s) is not Arabic and/or if one or more page number reset(s) is/are applied in the document, otherwise it must be unchecked automatically.
Figure 3: The PDF Options dialog box with ‘Add page labels’ unchecked (toggled FALSE).
Figure 4: The PDF Options dialog box with ‘Add page labels’ checked (toggled TRUE).
When export directly as PDF is performed, the page labels must be included if the page number format of one or more page style(s) is not Arabic and/or if one or more page number reset(s) is/are applied in the document, otherwise export directly as PDF without page labels.
4.2. The mechanism to overcome unavailable page number formats in the export format
If the project document (such as ODT, DOC, DOCX) contains page number formats from the page styles that are not available on the page number formats (numbering style) of the export format (such as PDF), the document accessibility issue link button ‘Incompatible page number format is used’ must present in the Accessibility Check, and export to that export format must substitute incompatible page number format for the page labels with page index in Arabic format. For example, we have an ODT document with pages [i,ii,iii,iv,1,2,3,4,5,6,7,8,1st,2nd,3rd,4th,5th,One,Two,Three,Four,Five,Six,Seven,Eight,Nine,Ten,Eleven,Twelve,Thirteen] with export format containing only Arabic (1, 2, 3…), Roman (i, ii, iii…), and Latin alphabet (a, b, c, …, y, z, aa, bb, cc…) page number formats, the exported document must have page labels [i,ii,iii,iv,1,2,3,4,5,6,7,8,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30].
For Latin alphabet page number format, there are two variants, such as [a, b, c, …, y, z, aa, ab, ac…] (supported by ODT but not PDF) and [a, b, c, …, y, z, aa, bb, cc…] (supported by ODT and PDF). PDF only supports [a, b, c, …, y, z, aa, bb, cc…] variant and for the project document containing page number format with that variant, the project document can be exported to PDF without compatibility issue with the page number format.
Annex A. The Raisfath's reason about PDF page labeling feature that must be made available in the LibreOffice
The reason begins when I wish for the document I created has the page numbers in the page navigator of the PDF viewer that are equivalent to the page numbers enclosed by the parenthesis or square brackets in LibreOffice.
So I open the document in the real PDF viewers to make sure that the page numbers in the page navigation tool are equivalent to that enclosed by the parenthesis or square brackets in LibreOffice. But in reality, the page numbers appear in the PDF page navigation tool are not based on the page numbers enclosed by the parenthesis or square brackets in LibreOffice. This makes a question about page numbering in the PDF document exported from LibreOffice.
So I tried to find out the documentation that defines the standard of PDF file format, it is ISO 32000 standard. So far I read the documentation about the standard, I found the term ‘page labels’ (page labeling feature) and is started from PDF version 1.3, it is used to allow PDF document to be capable of organizing page numbers of a document, which may come from written page numbers, and is used to make page navigation within the document easier to do. So for example, we want to go to the page 212 in a document containing 24 pages of front matter in Roman format, we arrived at the page 212 and not at the page 188, this is because page labels that make us easier in the page navigation.
So I wrote this document with ODT file embedded in this PDF file to be tested by you all, by exporting the embedded ODT document to PDF, and if you open the PDF document you exported from LibreOffice with many PDF viewers available from your computer and from internet, the page labels ARE NOT INCLUDED FROM IT!
Annex B. About Muhammad Raisfath in 2023 and present
I am programmer and computer science student that want to deeply know about computer architecture, computer programming, computer networking, cybersecurity, operating system (especially Linux), and neuroscience to develop cognitive artificial intelligence.
For more information about me, please refer to the attached document.
Annex C. System information
LibreOffice version: 25.2.4.3 Operating system : Windows 11 Home OS version : 24H2