Bug 155000 - PDF/UA Content controls in header/footer generate ""Widget" annotation not nested inside a "Form" structure element" error message in PAC tool
Summary: PDF/UA Content controls in header/footer generate ""Widget" annotation not ne...
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Printing and PDF export (show other bugs)
Version:
(earliest affected)
7.6.0.0 alpha0+
Hardware: All All
: medium normal
Assignee: Balázs Varga (allotropia)
URL:
Whiteboard: target:24.2.0
Keywords: accessibility
Depends on:
Blocks: PDF-Accessibility
  Show dependency treegraph
 
Reported: 2023-04-25 08:14 UTC by Gabor Kelemen (allotropia)
Modified: 2023-07-24 13:16 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments
Example file from Writer with content controls in header and footer (28.59 KB, application/vnd.oasis.opendocument.text)
2023-04-25 08:14 UTC, Gabor Kelemen (allotropia)
Details
The example file saved to PDF (30.80 KB, application/pdf)
2023-04-25 08:15 UTC, Gabor Kelemen (allotropia)
Details
Screenshot of the document in Writer and the issue in the PAC tool (155.74 KB, image/png)
2023-04-25 08:16 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-25 08:14:12 UTC
Created attachment 186905 [details]
Example file from Writer with content controls in header and footer

This is similar to bug 154990

When content controls are placed in the document header or footer and exported as PDF, the PAC tool gives an error message about them.

1. Open attached file
2. Save as PDF with the PDF/UA option enabled
3. Open it in the PAC tool
-> There is an error about both controls ""Widget" annotation not nested inside a "Form" structure element" 

(also their text is not visible in the PDF, but that may be bug 154984)

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-25 08:15:29 UTC
Created attachment 186906 [details]
The example file saved to PDF
Comment 2 Gabor Kelemen (allotropia) 2023-04-25 08:16:30 UTC
Created attachment 186907 [details]
Screenshot of the document in Writer and the issue in the PAC tool
Comment 3 Buovjaga 2023-05-15 13:59:02 UTC
Repro with PAC tool

Version: 7.6.0.0.alpha1+ (X86_64) / LibreOffice Community
Build ID: 6f1534940ac12ff8e46f4782e18cfb6cf585da39
CPU threads: 2; OS: Windows 10.0 Build 22621; UI render: default; VCL: win
Locale: en-US (en_FI); UI: en-US
Calc: threaded
Comment 4 Michael Stahl (allotropia) 2023-06-02 16:57:34 UTC
the forms are annotations in PDF, otherwise they don't work as forms in PDF viewers:

    11 0 obj
    <</Type/Annot/Subtype/Widget/F 4
    /Rect[284.299 56.701 308.351 70.499]
    /FT/Ch
    /P 1 0 R
    /T(_2)
    /Ff 131072
    /V <FEFF>
    /DV <FEFF>
    /Opt[
    <FEFF003000300030>
    <FEFF00680065006C006C006F>
    <FEFF0057006F0072006C0064>
    ]
    /TI 1
    /DR<</Font 7 0 R>>
    /DA(0 0 0 rg /F2 12 Tf)
    /AP<<
    /N 28 0 R
    >>
    >>
    endobj

    1 0 obj
    <</Type/Page/Parent 12 0 R/Resources 20 0 R/MediaBox[0 0 612 792]/Annots[
    5 0 R 11 0 R ]
    ...


and these forms are in the header and footer - but headers and footers are artifacts, and so is everything in them:

    ISO 14289-1:2014(E)

    7.1 General All real content shall be tagged as defined in ISO 32000-1:2008, 14.8. Artifacts (ISO 32000-1:2008, 14.8.2.2.2) shall not be tagged in the structure tree.

    7.8 Page headers and footers Running headers and footers shall be identified as Pagination artifacts and shall be classified as either Header or Footer subtypes as per ISO 32000-1:2008, 14.8.2.2.2, Table 330.


so if we create Annot structure elements for the forms, they would need to be parented in some sort of structure element for the header/footer, which doesn't exist and isn't allowed.

the only obvious improvement that comes to mind here is that the Accessibility Check warning dialog should complain about the forms in headers.

if the user insists on doing this, then i think they have to live with these PAC/veraPDF warnings.

does anybody have a better idea?
Comment 5 Commit Notification 2023-07-21 15:58:23 UTC
Balazs Varga committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/3f6ad9d3cdd6fe97989d85b7ec31fe9b8ae340cd

tdf#155000 - A11Y - Add warning message if content control in header/footer

It will be available in 24.2.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.