Bug 57710 - PDF writer's "Export automatically inserted blank pages" outputs wrong pages
Summary: PDF writer's "Export automatically inserted blank pages" outputs wrong pages
Status: RESOLVED DUPLICATE of bug 52316
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
3.6.3.2 release
Hardware: x86-64 (AMD64) All
: high minor
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-11-30 00:04 UTC by Steve Kelem
Modified: 2015-04-15 09:28 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:


Attachments
A tar file with the test case (458.42 KB, application/x-gzip)
2012-11-30 00:04 UTC, Steve Kelem
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Steve Kelem 2012-11-30 00:04:16 UTC
Created attachment 70807 [details]
A tar file with the test case

In the attached document, I have a master document, pdfpages1.odm, and two chapters, chap1.odt and chap2.odt.

If you open the master document and scroll to page 2-1, the page display in the lower right corner displays "Page 1 7/9". This indicates that I'm on Page 1 of the current chapter, but page 7 of the entire document, which is 9 pages long.

When I convert this page to PDF, and don't select "Export automatically inserted blank pages", and select Page 7, the pdf file contains only page 2-3, which is, according to LibreOffice's page display, page 9/9.

With some exhausting testing I get:
Print  Get
1      i
2      ii
3      iii
4      1-1
5      2-1
6      2-2
7      2-3
8      Error saving the document pdfpages1: Write Error. The file could not be written.

This means that the two blank pages (that would be used to fill out the right/left pages in a 2-sided document) are not only not printed (which is what the non-selected option implies), but they are not included in the page count.

1. This means that LO's Page display, "Page 1 7/9" does not display enough info to choose the pages to be output! How can I choose which pages to convert to PDF if there is no indication of how many blank pages are not being printed?

2. This option should still rely on the LO Page display, but not output the blank pages. This would screw up 2-sided printing if there are intervening pages that are not output, but I think that's a given with the "don't export blank pages" option.

3. Here's a more fundamental question: Why are the "blank" pages blank? Why aren't the headers, footers, and watermarks there?
Comment 1 Steve Kelem 2012-11-30 00:05:23 UTC
To clarify point 2, if you select pages 7-9, and 8 happens to be a blank page, then you should output pages 7 & 9.
Comment 2 Steve Kelem 2012-11-30 00:16:11 UTC
By the way, I've been beating my head against this "feature" for a few years!
It wasn't until I built this test case that I figured out what was going on!
I used to have to write out what I thought were the correct pages, then examine the document to see what really got output. Then I would subtract how much it was off from the selected page numbers and try it again. Combined with not knowing how many pages are blank in my 600 page document, or even noticing that this option existed, and the fact that LibreOffice will reformat the pages whenever I output PDF (even if I run Tools/Update/Page Formating), thus changing the page numbering, I have to iterate at least 3 times before I get the desired pages.

So, my workaround will be to turn on the Export Blank Pages option, even though, because I print only a full chapter at a time...AND THERE ARE NO BLANK PAGES IN THE RANGE OF PAGES I'M PRINTING.
Comment 3 Petr Mladek 2012-11-30 13:51:22 UTC
This is pretty complex scenario. The problem is there for years and nobody reported it yet. I am sorry but such bugs does not belong to the MABs.

Anyway, I added some Writer hackers into CC. They will look into it when they have time. Note that the are many other important bugs around.
Comment 4 Steve Kelem 2012-11-30 17:49:51 UTC
Actually the scenario is simple, and it happens to people who have documents with more than one chapter.

It occurs in documents that have blank pages, usually because of chapters with an odd number of pages.

The current page counter at the bottom left of the LO window shows the local page number, the global page number and the max number of pages, e.g., "ii 5/200".

The "don't export blank pages" option for PDF ignores the global and max pages, counting only non-blank pages. There is no display of current page number and max # of pages, but not including blank pages, yet the "don't export blank pages" option interprets the user's page specification with respect to this internal count of non-blank pages instead of the displayed page numbers. The user gets the wrong pages if he specifies pages based on what LO tells him are the page numbers.

The most straight-forward, easy for the user to understand, fix for this is bullet point 2 in my original posting.
Comment 5 Joel Madero 2013-06-24 01:18:51 UTC
Thank you for reporting this issue! I have been able to confirm the issue on:
Version: 4.2.0.0.alpha0+Build ID: b0a1666f756aa5f5315366eca9d7d02ddd55d2b
Date:   Tue May 28 08:51:01 2013 +0300 
Platform: Bodhi Linux 2.2 x64

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
As I've been able to confirm this problem I am marking as:

New (confirmed)
Minor - does not prevent high quality work but can slow it down (see note below for workaround)
High - page count working incorrectly for pdf export can be quite annoying and the workaround is only half functional as it removes PDF export options from the equation.


Workaround: if you do a print to file (vs. export) it works as expected and you can get your pdf

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
LibreOffice is powered by a team of volunteers, every bug is confirmed (triaged) by human beings who mostly give their time for free. We invite you to join our triaging by checking out this link:
https://wiki.documentfoundation.org/QA/BugTriage and join us on freenode at #libreoffice-qa

There are also other ways to get involved including with marketing, UX, documentation, and of course developing -  http://www.libreoffice.org/get-help/mailing-lists/. 

Lastly, good bug reports help tremendously in making the process go smoother, please always provide reproducible steps (even if it seems easy) and attach any and all relevant material
Comment 6 Timur 2013-09-30 13:41:53 UTC
Added Bug 52316 titled " Corruption function of pages" to "See Also".
Comment 7 Cédric Bosdonnat 2014-01-20 08:57:11 UTC
Restricted my LibreOffice hacking area
Comment 8 Timur 2014-11-19 15:02:05 UTC
Bug 52316 (earlier, and explained now) and bug 57710 (more complex case and explanation) refer to the same problem, so one should be marked as a duplicate. I suggest this bug 57710 be marked because it's later later. Master document or normal document doesn't make a difference, it's blank pages which do.
Comment 9 Timur 2015-04-15 09:28:08 UTC

*** This bug has been marked as a duplicate of bug 52316 ***