Bug 156272 - PDF Export: Form control for date won't set date format to default format of Writer
Summary: PDF Export: Form control for date won't set date format to default format of ...
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Printing and PDF export (show other bugs)
Version:
(earliest affected)
7.5.4.2 release
Hardware: x86-64 (AMD64) Linux (All)
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: PDF-Export
  Show dependency treegraph
 
Reported: 2023-07-13 13:55 UTC by Robert Großkopf
Modified: 2023-08-02 05:08 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:


Attachments
Test export the form to pdf - default format of system isn't exported. (9.62 KB, application/vnd.oasis.opendocument.text)
2023-07-13 13:55 UTC, Robert Großkopf
Details

Note You need to log in before you can comment on or make changes to this bug.
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.