Bug 118378 - Page Number is Wrong if a Selection is Printed
Summary: Page Number is Wrong if a Selection is Printed
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Printing and PDF export (show other bugs)
(earliest affected) release
Hardware: All All
: low enhancement
Assignee: Not Assigned
: 140499 (view as bug list)
Depends on:
Blocks: Print Print-Preview
  Show dependency treegraph
Reported: 2018-06-25 19:33 UTC by Harald Koester
Modified: 2022-01-27 21:48 UTC (History)
5 users (show)

See Also:
Crash report or crash signature:

Example document (10.22 KB, application/vnd.oasis.opendocument.text)
2018-06-25 19:33 UTC, Harald Koester

Note You need to log in before you can comment on or make changes to this bug.
Description Harald Koester 2018-06-25 19:33:31 UTC
Created attachment 143110 [details]
Example document

I order to reproduce:

[1] Open attached document.
[2] Select the content of page 2 and page 3.
[3] Print selected pages:
(a) Menu: File > Print > General > Selection. A preview of page 2 is displayed. The page number is 4. Expeted: 2.
(b) Click OK: Pages 2 and 3 are printed. The page number on both pages is 4. Expected: 2 and 3.

The page numbers are also wrong if you export the selected pages to a pdf document. 

Tested with version 6.0.5 (64 bit, Win 10).

Bug already exists with version 3.6.7. Version 3.3.0 behaves different, but the page numbers are also wrong.
Comment 1 Jean-Baptiste Faure 2018-06-25 20:31:19 UTC
Reproducible for me with LO, with LO 6.0.4 and LO
Note: you need to use print dialog from LibreOffice (option set in menu Tools > Options > LibreOffice > General)

Status set to NEW.

Best regards. JBF
Comment 2 Jean-Baptiste Faure 2018-06-25 20:33:18 UTC
I did my tests under Linux -> set OS accordingly.

Best regards. JBF
Comment 3 Justin L 2020-06-18 17:41:22 UTC
Repro 7.1+
Comment 4 Timur 2021-02-18 16:13:32 UTC
*** Bug 140499 has been marked as a duplicate of this bug. ***
Comment 5 Justin L 2021-03-31 09:28:04 UTC
Although OP's perspective is probably the most common one, I suppose that this scenario is a bit ambiguous. There might be situations where the current situation is desirable.

The workaround I would use would be to export the entire document to PDF, and then print selected pages from the PDF.

However, that doesn't really solve the problem of printing a "selection" - since that might not be requesting the entire pages.

But even the selection might not meet expectations - since basically it seems to be creating a new document and just printing that. (Using attachment 143110 [details] as an example, I selected to print just one 2, and two 3's.  The result was not one 2 on the first page, and two 3's on the second page, but a 2,3 on the first page, and the remaining 3 on the second page.)

So, basically page numbers are irrelevant when printing a selection - it doesn't even make sense to use the current page numbers since the content might be different from what would be printed on that page when the entire document is printed.

What does Microsoft do in this situation?  Word 2016 did the same as LO - except that it did not print the header or footer at all.
Comment 6 Ulrich Windl 2021-04-06 07:07:20 UTC
There might not be a perfect solution for this problem, and possibly looking only what Microsoft does also isn't the perfect solution.
I wonder: If you take the traditional workflow of extracting a few pages from a book using a photo-copier, that would be the approach of just printing selected pages from a PDF.  However when you extract whole pages, more than desired would be printed, and when you would "white redact" the non-selected parts on the first and last pages, then someone might complain that paper is wasted (e.g. if 90% of the first page is blank, while the last page only used 10%).
"Reflowing" the text would prevent unused blank areas, but it would break formatting.  So I have a weak tendency towards the "white-redacted PDF pages" approach. The other advantage would probably be that automatic text references and chapter numbers would be right.
Maybe there could also be some checkbox that toggles between "preserve page layout and references" and "reflow text, saving paper".
Comment 7 Heiko Tietze 2021-04-06 09:34:42 UTC Comment hidden (me-too)
Comment 8 BogdanB 2022-01-27 21:48:03 UTC
I retested printing as PDF.

The content printed it's correct. Just the page number is 4 on pages 2 and 3.

Retested on
Version: / LibreOffice Community
Build ID: 2f4f4cbeb8e50081d607b86b0475b93971c40ab8
CPU threads: 16; OS: Linux 5.13; UI render: default; VCL: gtk3
Locale: ro-RO (ro_RO.UTF-8); UI: en-US
Calc: threaded