Bug 158558 - Export directly to PDF is fundamentally broken - differs from print, alters and breaks complex documents
Summary: Export directly to PDF is fundamentally broken - differs from print, alters a...
Status: NEEDINFO
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
7.5.8.2 release
Hardware: All Linux (All)
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-12-06 06:46 UTC by Troy Rollo
Modified: 2023-12-27 04:05 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Troy Rollo 2023-12-06 06:46:49 UTC
Description:
Using the PDF export button in Writer, if I have a hidden paragraph that is also a numbered paragraph, the paragraph numbers are printed. This does not affect printing, only exporting to PDF.

Steps to Reproduce:
1. Create a series of numbered paragraphs.
2. Insert some text in the numbered paragraphs.
3. Insert the "hidden paragraph" field at the start of each of the paragraphs
4. Export to PDF

Actual Results:
The numbered paragraphs are shown in the PDF with their paragraph numbers but without the text of the paragraph.

Expected Results:
The entire paragraph, including the paragraph numbers, should be omitted as occurs when printing.


Reproducible: Always


User Profile Reset: No

Additional Info:
Version: 7.5.8.2 (X86_64) / LibreOffice Community
Build ID: 50(Build:2)
CPU threads: 32; OS: Linux 6.1; UI render: default; VCL: gtk3
Locale: en-AU (en_AU.UTF-8); UI: en-US
Debian package version: 4:7.5.8-1~bpo12+1
Calc: threaded
Comment 1 Troy Rollo 2023-12-06 07:20:02 UTC
On further testing, something has gone very wrong with the PDF export in this latest version. It can differ in other ways from a print to PDF, a print to paper, or a print preview. If I have a two-column section on the page, followed by a one-column section, the second section is forced onto the next page and the two-column section does not (as it should) split the content evenly between the two columns (instead continuing down the left hand column and leaving the right hand column empty). Has there been a complete rewrite?
Comment 2 Troy Rollo 2023-12-06 07:31:50 UTC
I can also see that the document is being altered before the PDF export and then altered after (the alterations show progressively on screen as if somebody were editing the document).

Also if I put numbered paragraphs in a hidden section, and reference the content of the numbered paragraphs elsewhere (with a cross-reference to the numbered paragraph), the cross-references get broken on export to PDF. It is as if the hidden section is being deleted then reinserted so that the cross-references no longer link to the right place.

The whole approach being taken in this PDF export now seems to be fundamentally broken as designed. The PDF export should not be altering the document.
Comment 3 Troy Rollo 2023-12-06 07:48:03 UTC
Also tried leaving my numbered paragraphs out of a hidden section, then changing the numbering style so that its numbering format is "none" and removing the before-and-after text - the PDF export seems to delete the paragraph entirely then reinstate it after the export, and the cross-references break again.
Comment 4 Troy Rollo 2023-12-06 07:52:22 UTC
Actually it seems to delete the hidden paragraph content no matter what, when doing the PDF export, leaving the cross-references broken.

This export engine is unworkable. Is there any way to revert to the old PDF export short of going back to an earlier version of LibreOffice?

These bugs should be ranked as critical. An export engine that modifies the document contents should never have been allowed into the code base.
Comment 5 Troy Rollo 2023-12-06 08:03:34 UTC
It seems this can be ameliorated by, instead of exporting directly to PDF (using the button or the corresponding menu item), using the "Export as PDF..." menu item and going through the dialog. It is not at all clear why the behaviour should be so different between the two.
Comment 6 m_a_riosv 2023-12-06 15:01:24 UTC
Both, through menu or icon (directly) are the same, and the second use the last options selected in the first.

Please test in safe mode, Menu/Help/Restart in Safe Mode

Please attach a sample file.