Bug 118614 - When a form showing a date field containing a valid date is exported as a PDF file with "Create PDF form" checked, the resultant PDF file shows an empty field.
Summary: When a form showing a date field containing a valid date is exported as a PDF...
Status: UNCONFIRMED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Printing and PDF export (show other bugs)
Version:
(earliest affected)
Inherited From OOo
Hardware: x86-64 (AMD64) Windows (All)
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords: filter:pdf, needsDevAdvice
Depends on:
Blocks: PDF-Export
  Show dependency treegraph
 
Reported: 2018-07-07 20:58 UTC by Alan Wheeler
Modified: 2019-03-16 19:07 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments
To demonstrate empty date field (11.09 KB, application/vnd.sun.xml.base)
2018-07-07 20:58 UTC, Alan Wheeler
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Alan Wheeler 2018-07-07 20:58:46 UTC
Created attachment 143382 [details]
To demonstrate empty date field

When a form showing a date field containing a valid date is exported as a PDF file with "Create PDF form" checked, the resultant PDF file shows an empty field.

To demonstrate :-
1.	Open the attached "Test5 - Date.odb" database file.
2.	Open form "Form1" - this will display a form containing a single field of type date containing "31/12/81".
3.	From the menu bar, select "File", then "Export as PDF..."
4.	On the right hand side of the resultant "PDF Options" panel, check only "Create PDF Form" and "View PDF after export", then select "Export"
5.	Save the resultant PDF file to a convenient place - it will then be automatically displayed.
6.	Observe that the PDF file contains a single empty editable field - it has not been preset to contain "31/12/81"
Comment 1 Alan Wheeler 2018-07-07 21:40:29 UTC
Bug 107402 (now shown as WORKSFORME) described similar symptoms as part of a more general complaint about exporting as PDF. The current bug report is more specific, so should be easier to reproduce (and hopefully fix). Should bug 107402 be marked as a duplicate of this one (118614)?
Comment 2 Drew Jensen 2018-07-07 22:30:49 UTC
(In reply to Alan Wheeler from comment #0)
> Created attachment 143382 [details]
> To demonstrate empty date field
> 
> When a form showing a date field containing a valid date is exported as a
> PDF file with "Create PDF form" checked, the resultant PDF file shows an
> empty field.
> 

Yes, I can confirm that there is no way to get that default string into the form control in the PDF file. 

Doing a search just nor though I find that even with Adobe tools the solution to default dates as strings (and other strings defaults) is by using a snippet of javascript embedded in the PDF file. The adobe tools offer a scripting environment similar to that in LibreOffice for basic (etc.).

So, I'm not sure this is an error in LibreOffice. 
It would be great if there were an OS tool that would let you apply the solution from recommended in the Adobe forums.
Comment 3 Alan Wheeler 2018-07-30 00:59:52 UTC
I have discovered a workaround.

If, after the form is displayed, but before exporting as PDF, the date field is modified (I added a space after "31/12/81", then removed the space), the field in the resultant PDF file HAS been preset to "31/12/81".

If the form contains several date fields, it is necessary to modify each one in order for all the relevant fields on the resultant PDF file to have been preset.
Comment 4 Alan Wheeler 2018-09-05 14:20:38 UTC
Tested with LibreOffice 3.3.0.
Exactly the same symptoms as described in the original bug report are exhibited using 3.3.0, so set version to "Inherited from OOo"