Bug 156272

Summary: PDF Export: Form control for date won't set date format to default format of Writer
Product: LibreOffice Reporter: Robert Großkopf <robert>
Component: Printing and PDF exportAssignee: Not Assigned <libreoffice-bugs>
Status: NEW ---    
Severity: normal CC: buzea.bogdan
Priority: medium    
Version: 7.5.4.2 release   
Hardware: x86-64 (AMD64)   
OS: Linux (All)   
Whiteboard:
Crash report or crash signature: Regression By:
Bug Depends on:    
Bug Blocks: 103378    
Attachments: Test export the form to pdf - default format of system isn't exported.

Description Robert Großkopf 2023-07-13 13:55:14 UTC
Created attachment 188350 [details]
Test export the form to pdf - default format of system isn't exported.

Open the attached Document.
It only contains a date control, which is set to Date Format → Standard (short).
Export this document to PDF.
Open this exported *.pdf with a simple text editor (used here: kate)
You could find this 2 rows:

/F<</JS(AFDate_FormatEx\("mm/dd/yy"\);)/S/JavaScript>>
/K<</JS(AFDate_KeystrokeEx\("mm/dd/yy"\);)/S/JavaScript>>

Every pdf-viewer, which reads this JavaScript, will only allow to set the format to "mm/dd/yy". You could test this in Firefox or other viewer, not in Okular, which doesn't read this rows.

You could also read the language, which is the default for Local Settings:

/Lang(de-DE)

But the format has nothing to do with the local setting. Should be "dd.mm.yy", if Standard (short) will work right.

It is impossible to get this format when exporting to *.pdf, because it won't be offered by the data control.

Best solution will be to set the date format to the default format of the system, if default format has been chosen.
Comment 1 Dieter Menne 2023-07-13 16:44:07 UTC
Was found in a discussion between Robert and me.
Comment 2 Robert Großkopf 2023-07-13 17:41:16 UTC
Depending on comment 1 and this thread
https://ask.libreoffice.org/t/beim-export-nach-pdf-wird-das-datumsformat-auf-10-07-23-eingestellt-wie-bekomme-ich-10-07-23/93526

I will set this one to NEW.