Bug 162009 - Change the default PDF option to NOT export as form by default (because content in content controls don't export well)
Summary: Change the default PDF option to NOT export as form by default (because conte...
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
24.2.5.2 release
Hardware: All All
: medium normal
Assignee: Miklos Vajna
URL:
Whiteboard: target:25.2.0 target:24.8.0.3 target:...
Keywords:
Depends on:
Blocks: DOCX-Content_Control
  Show dependency treegraph
 
Reported: 2024-07-12 04:06 UTC by SATYA SRINIVAS K
Modified: 2024-08-08 21:59 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments
Source file (86.12 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2024-07-12 04:07 UTC, SATYA SRINIVAS K
Details
pdf converted from Libre office (110.60 KB, application/pdf)
2024-07-12 04:08 UTC, SATYA SRINIVAS K
Details
pdf converted from MS office (135.68 KB, application/pdf)
2024-07-12 04:10 UTC, SATYA SRINIVAS K
Details
MSO_vs_LO (138.89 KB, image/png)
2024-07-12 04:14 UTC, SATYA SRINIVAS K
Details
Minimal reproducer (18.59 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2024-07-29 14:29 UTC, Miklos Vajna
Details

Note You need to log in before you can comment on or make changes to this bug.
Description SATYA SRINIVAS K 2024-07-12 04:06:35 UTC
Description:
Some text is missing when converted attached docx file to pdf.
It looks like that, the text is missing but when we click on it scrolling option appears and the text avaiable on the next line.

Steps to Reproduce:
1.Open the attached "Pxxx Survey Strategy_OpenTextScrubbed.docx" file in libre office.
2.Export the file to pdf.
3.Open the PDF and observe that, the text "Strategy" is missing.
4.All looks fine when the same docx file is converted to PDF using ms office. 

Actual Results:
The text is missing in the converted pdf.

Expected Results:
Libre office converted pdf should be same as pdf converted from MS office.


Reproducible: Always


User Profile Reset: No

Additional Info:
Version: 24.2.5.2 (X86_64) / LibreOffice Community
Build ID: bffef4ea93e59bebbeaf7f431bb02b1a39ee8a59
CPU threads: 12; OS: Windows 10.0 Build 19041; UI render: Skia/Raster; VCL: win
Locale: en-US (en_US); UI: en-US
Calc: threaded
Comment 1 SATYA SRINIVAS K 2024-07-12 04:07:00 UTC
Created attachment 195248 [details]
Source file
Comment 2 SATYA SRINIVAS K 2024-07-12 04:08:35 UTC
Created attachment 195249 [details]
pdf converted from Libre office
Comment 3 SATYA SRINIVAS K 2024-07-12 04:10:11 UTC
Created attachment 195250 [details]
pdf converted from MS office
Comment 4 SATYA SRINIVAS K 2024-07-12 04:14:38 UTC
Created attachment 195251 [details]
MSO_vs_LO
Comment 5 Mike Kaganski 2024-07-12 04:29:27 UTC
LibreOffice allows to export fields as PDF forms, and the content controls were added recently [1]. In that mode (the default), Adobe Reader uses a bit different font, so the content doesn't fit to the box exactly, and splits into two lines, and the second of them is available by scrolling. Note, that e.g. Google Chrome's built-in PDF reader shows it correctly.

It is incorrect to compare the PDFs created as forms, to what Word generates (which is plain PDF). If you unselect PDF forms in Writer's PDF export, the PDF will be the same, without the problem.

It is unclear, if the export could be improved. Also, it seems that the first content control should include the first character, too?

[1] https://vmiklos.hu/blog/sw-content-controls4.html
Comment 6 Miklos Vajna 2024-07-12 06:37:08 UTC
> In that mode (the default)

I wonder if it's a good default to create PDF forms, instead of producing perfect output when you can't have both at the same time.

I assume this bug would be fixed if we would default to not creating PDF forms from content control/form control?
Comment 7 Mike Kaganski 2024-07-12 07:48:32 UTC
(In reply to Miklos Vajna from comment #6)
> I assume this bug would be fixed if we would default to not creating PDF
> forms from content control/form control?

That would be a reasonable change IMO. It would make the default export matching expectations, and would almost fix this.
Except the questions in comment 5. Especially about the first character being outside of the control.
Comment 8 SATYA SRINIVAS K 2024-07-15 04:44:16 UTC
Is there a way to disable the "Create PDF form" option when exporting to PDF using  --headless --convert-to pdf (without GUI) ?
Comment 9 Mike Kaganski 2024-07-15 05:05:37 UTC
(In reply to SATYA SRINIVAS K from comment #8)

https://help.libreoffice.org/latest/en-US/text/shared/guide/pdf_params.html?&DbPAR=SHARED
Comment 10 Justin L 2024-07-23 14:37:21 UTC
(In reply to SATYA SRINIVAS K from comment #8)
> Is there a way to disable the "Create PDF form" option when exporting to PDF
Comment 9 indicates that there is a configuration option to handle this, but it is not something that can be specified at the command line. It is part of the user profile.

So, it could be set via an extension for example.

The sample configuration extension does exactly that - disables creating PDF forms (along with various other useful changes)
https://wiki.documentfoundation.org/File:Sample_LO_configuration_extension.oxt

I made a patch to turn off "create PDF form" by default since the PDFs we create that contain content controls are actually really poor.
https://gerrit.libreoffice.org/c/core/+/152622

However, I do not fell comfortable having my name associated with this change. There seem to be some internal PDF structures that depend on forms being enabled in order for some unit tests to pass. They don't really seem to be involved in export in the normal process. However, I don't like being required to have some parts of LO default to true and other parts default to false.

So I will abandon that patch and leave it to PDF people to pick it up if they want it.
Comment 11 Justin L 2024-07-23 14:56:21 UTC
(In reply to Mike Kaganski from comment #7)
> Except the questions in comment 5. Especially about the first character
> being outside of the control.
That is bug 158661
Comment 12 Miklos Vajna 2024-07-29 14:29:56 UTC
Created attachment 195586 [details]
Minimal reproducer

Attaching an other small reproducer: content control has rich text -- unless ExportFormFields is turned off, the "bbb" text will turn into plain text in the PDF case.
Comment 13 Miklos Vajna 2024-07-30 10:29:41 UTC
https://gerrit.libreoffice.org/c/core/+/171226 fixes this on master, just I mistyped the bug number, sorry about that.
Comment 14 SATYA SRINIVAS K 2024-07-31 04:48:10 UTC
(In reply to Miklos Vajna from comment #13)
> https://gerrit.libreoffice.org/c/core/+/171226 fixes this on master, just I
> mistyped the bug number, sorry about that.

Can you backport this fix to 24.2.6. ?
Comment 15 Commit Notification 2024-07-31 18:50:44 UTC
Miklos Vajna committed a patch related to this issue.
It has been pushed to "libreoffice-24-8":

https://git.libreoffice.org/core/commit/b8acf1f2a08c3be2948281e39ec9fdccd5111870

tdf#162009 PDF export: disable export of form fields as PDF forms by default

It will be available in 24.8.1.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 16 Miklos Vajna 2024-08-01 06:20:02 UTC
(In reply to SATYA SRINIVAS K from comment #14)
> Can you backport this fix to 24.2.6. ?

Already proposed at https://gerrit.libreoffice.org/c/core/+/171335, thanks to Xisco.
Comment 17 SATYA SRINIVAS K 2024-08-01 06:22:02 UTC
(In reply to Miklos Vajna from comment #16)
> (In reply to SATYA SRINIVAS K from comment #14)
> > Can you backport this fix to 24.2.6. ?
> 
> Already proposed at https://gerrit.libreoffice.org/c/core/+/171335, thanks
> to Xisco.

Thank you Miklos and Xisco.
Comment 18 Commit Notification 2024-08-01 06:27:07 UTC
Miklos Vajna committed a patch related to this issue.
It has been pushed to "libreoffice-24-2":

https://git.libreoffice.org/core/commit/81c883cf116bd8cd6e0901f5813c20783fa6051e

tdf#162009 PDF export: disable export of form fields as PDF forms by default

It will be available in 24.2.6.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 19 Commit Notification 2024-08-08 20:44:42 UTC
Miklos Vajna committed a patch related to this issue.
It has been pushed to "libreoffice-24-8-0":

https://git.libreoffice.org/core/commit/bff2b51403707ab9a4e98b861bea0099ed87b08c

tdf#162009 PDF export: disable export of form fields as PDF forms by default

It will be available in 24.8.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.