Bug 154984 - Content controls and form controls are not exported to PDF, if "Archive" and "Create PDF-Form" are both chosen
Summary: Content controls and form controls are not exported to PDF, if "Archive" and ...
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Printing and PDF export (show other bugs)
Version:
(earliest affected)
7.5.2.2 release
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: PDF 154990
  Show dependency treegraph
 
Reported: 2023-04-24 13:27 UTC by Gabor Kelemen (allotropia)
Modified: 2023-07-19 16:50 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments
Example file from Writer with content controls (14.00 KB, application/vnd.oasis.opendocument.text)
2023-04-24 13:27 UTC, Gabor Kelemen (allotropia)
Details
The example file saved to PDF (35.58 KB, application/pdf)
2023-04-24 13:27 UTC, Gabor Kelemen (allotropia)
Details
The example file in Writer and its PDF version in Acrobat (84.10 KB, image/png)
2023-04-24 13:28 UTC, Gabor Kelemen (allotropia)
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Gabor Kelemen (allotropia) 2023-04-24 13:27:23 UTC
Created attachment 186881 [details]
Example file from Writer with content controls

Attached example file contains one of each content control types Writer currently supports.
When saved as PDF, these are not visible except for the image placeholder.

1. Open attached file
2. Save as PDF, open it in some PDF viewer

-> The content controls texts are not visible.

Version: 7.6.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: 006b35d50024b1932d84380b5d2fec1f7066bccd
CPU threads: 14; OS: Windows 10.0 Build 19045; UI render: default; VCL: win
Locale: en-US (hu_HU); UI: en-US
Calc: threaded
Comment 1 Gabor Kelemen (allotropia) 2023-04-24 13:27:53 UTC
Created attachment 186882 [details]
The example file saved to PDF
Comment 2 Gabor Kelemen (allotropia) 2023-04-24 13:28:56 UTC
Created attachment 186883 [details]
The example file in Writer and its PDF version in Acrobat
Comment 3 Gabor Kelemen (allotropia) 2023-04-25 08:30:15 UTC
Another observation: unchecking the Archive box in the PDF options dialog makes these appear.
Comment 4 Gabor Kelemen (allotropia) 2023-04-25 08:34:36 UTC
Also: Having the Create PDF form box is also needed.
So enabling Archive with "Create PDF form" box together makes them disappear, if only one of them is checked, they appear.

But then: what's the point of having an Archive PDF with fillable form controls? Maybe a bit of UI trickery is enough to fix this?
Comment 5 Robert Großkopf 2023-04-25 08:54:28 UTC
Couldn't confirm the buggy behavior with
Version: 7.5.2.2 (X86_64) / LibreOffice Community
Build ID: 53bb9681a964705cf672590721dbc85eb4d0c3a2
CPU threads: 6; OS: Linux 5.14; UI render: default; VCL: kf5 (cairo+xcb)
Locale: de-DE (de_DE.UTF-8); UI: de-DE
Calc: threaded

Works also with
Version: 7.6.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: 3ec73488e447a693a14a773a7fb96938036c0324
CPU threads: 6; OS: Linux 5.14; UI render: default; VCL: kf5 (cairo+xcb)
Locale: de-DE (de_DE.UTF-8); UI: en-US
Calc: threaded

Content controls are visible in both exports.

Tested with openSuSE 15.4 64bit rpm Linux.
Comment 6 Robert Großkopf 2023-04-25 09:09:31 UTC
Could confirm the behavior if 
PDF-Options → General → General → Archive
and
PDF-Options → General → General → Create PDF-Form 
are both activated.
If only one of them has been activated it will work well.

If there are "normal" form controls these controls won't be shown also.
Tested this with a textbox.
Comment 7 Michael Stahl (allotropia) 2023-07-19 16:50:19 UTC
found out the following, testing with Evince:

the form controls are painted if this key is present below /AcroForm:

/NeedAppearances true

it is explicitly omitted when signing is enabled, or any version of PDF/A.

however, the form controls themselves are in the PDF, and if you know where they are you can click and select the forms (at least in Evince).

  A flag specifying whether
  to construct appearance streams and appearance
  dictionaries for all widget annotations in the document (see
  12.7.4.3, "Variable text"). Default value: false. A PDF writer
  shall include this key, with a value of true, if it has not
  provided appearance streams for all visible widget
  annotations present in the document.

i don't have PDF/A specs so it's not clear if "/NeedAppearances true" would be allowed by any of the versions (could be copypasta, there is another form-related check elsewhere that is only for version 1).