Bug 159895

Summary: FILESAVE PDF Tagged PDF export with Forms enabled results in "Stack empty" error in PAC
Product: LibreOffice Reporter: Gabor Kelemen (allotropia) <kelemeng>
Component: WriterAssignee: Not Assigned <libreoffice-bugs>
Status: NEW ---    
Severity: normal CC: stephane.guillou
Priority: medium Keywords: implementationError
Version: 7.5.0.3 release   
Hardware: All   
OS: All   
Whiteboard:
Crash report or crash signature: Regression By:
Bug Depends on:    
Bug Blocks: 139007    
Attachments: Example file from Writer
The example file exported as PDF from current master
Screenshot of the example document and the PAC error message

Description Gabor Kelemen (allotropia) 2024-02-26 07:36:03 UTC
Created attachment 192770 [details]
Example file from Writer

Attached example file contains two content controls (the bug does not happen with only one). When this is exported as tagged PDF with the Create PDF Form option enabled, PAC tools PDF/UA check will fail with the message "Stack empty".

1. Open attached file (or attachment 186881 [details] from bug 154984 to test with every supported content controls)
2. Export as PDF, with the Tagged PDF and Create PDF forms options enabled.
3. Open the resulting PDF (or  attachment 186882 [details] from bug 154984 ) in the PAC 2021 tool
-> "Stack empty" exception box appears early in the checking, indicating there is some internal inconsistency in the exported PDF.
If the PDF/UA option is also enabled, or the Create PDF form option is not enabled, this error does not happen.

Version: 24.8.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: 8eee7eab8087590aa19bb9989c294e9be767f356
CPU threads: 15; OS: Windows 10.0 Build 19045; UI render: default; VCL: win
Locale: hu-HU (hu_HU); UI: en-US
Calc: default

Seems to have started in 7.5 with:

https://git.libreoffice.org/core/+/6b2433f3b66c1f118dabcd40924122deb2d4f204

author	Miklos Vajna <vmiklos@collabora.com>	Wed Sep 14 08:35:28 2022 +0200
committer	Miklos Vajna <vmiklos@collabora.com>	Wed Sep 14 10:08:04 2022 +0200

sw content controls, dropdown: add PDF export
Comment 1 Gabor Kelemen (allotropia) 2024-02-26 07:36:26 UTC
Created attachment 192771 [details]
The example file exported as PDF from current master
Comment 2 Gabor Kelemen (allotropia) 2024-02-26 07:37:40 UTC
Created attachment 192772 [details]
Screenshot of the example document and the PAC error message
Comment 3 Stéphane Guillou (stragu) 2024-03-11 11:25:57 UTC
reproduced with PDF exported with:

Version: 24.2.1.2 (X86_64) / LibreOffice Community
Build ID: db4def46b0453cc22e2d0305797cf981b68ef5ac
CPU threads: 4; OS: Windows 10.0 Build 22631; UI render: Skia/Raster; VCL: win
Locale: en-US (en_US); UI: en-US
Calc: threaded

and analysed with PAC 21.0.0.0.