[ 
https://issues.apache.org/jira/browse/PDFBOX-3636?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15761410#comment-15761410
 ] 

Tilman Hausherr commented on PDFBOX-3636:
-----------------------------------------

I get "01.01" which is correct with this code:
{code}
PDDocument doc = PDDocument.load(new 
URL("https://issues.apache.org/jira/secure/attachment/12843872/dv_kanal.pdf";).openStream());
PDField field = 
doc.getDocumentCatalog().getAcroForm().getField("inspektionsdatum3");
System.out.println(field.getValueAsString());
{code}
What you saw 
{code}
/Tx BMC
  q
    1 1 81.371 20.001 re
    W
    n
    BT
      /Helv 10 Tf
      0 g
      2 7.291 Td
      (01.01.2016) Tj
    ET
  Q
EMC
{code}
is the appearance stream. I suspect that one is calculated after some 
javascript (I saw this: {{AFDate_KeystrokeEx("dd.mm.yyyy"); }}) has run.

> Wrong value read from date field
> --------------------------------
>
>                 Key: PDFBOX-3636
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-3636
>             Project: PDFBox
>          Issue Type: Bug
>          Components: AcroForm
>    Affects Versions: 2.0.4
>         Environment: windows 10
>            Reporter: Aleksandar Veljovic
>         Attachments: dv_kanal.pdf
>
>
> I have defined a date field in my PDF with the format "dd.mm.yyyy". Reading 
> the value (field.getValueAsString()) works as expected if the input is a 
> whole date string.
> Now when I set the field to e.g. "10.10" the value is accepted and displayed 
> as "10.10.2016" (probably always the current year). But when I try to read 
> the field it always delivers null and not what is displayed in the PDF.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to