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

Maruan Sahyoun commented on PDFBOX-2619:
----------------------------------------

So, from a conversation I had with Olaf Drümmer, the date comparison shall fail 
in that case as the XMP date has a time zone and the PDF information dictionary 
date has none which makes the PDF date ambigious as it’s unclear in which time 
zone it shall be. So if there is a timezone information in one of the dates the 
other shall have a time zone information too. Other than that the date 
information needs to resolve to the same point in time for both dates.

>From the spec
{quote}
Date properties are formatted as a variable-length sequence of temporal 
components ranging in granularity: year, month, day, hour, minute, second. For 
properties that map between the PDF date type, defined by PDF Reference 3.8.2, 
and the XMP Date type, defined by Date and Time Formats, value equivalence 
shall be on a component-by-component basis, relative to Coordinated Universal 
Time (UTC), i.e., correcting for local time zone offset.
{quote}

and
{quote}
EXAMPLE 2 The document information dictionary entries:
/CreationDate (D:20040402)
/ModDate (D:20040408091132-05'00')
are equivalent to the XMP properties:
<xmp:CreateDate>2004-04-02</xmp:CreateDate>
<xmp:ModifyDate>2004-04-08T14:11:32Z</xmp:ModifyDate>
{quote}

So comparing the Calendar entries is fine but we also need to check if there is 
a time zone information for both dates if at least one of the dates has one.

There is still the difference between Acrobat and PDFTools so doing above check 
will provide the same result for that case compared to Acrobat but not to 
PDFTools and maybe others

> XMP dates contain time zone, while document info dates do not, and this isn't 
> detected by preflight
> ---------------------------------------------------------------------------------------------------
>
>                 Key: PDFBOX-2619
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-2619
>             Project: PDFBox
>          Issue Type: Sub-task
>          Components: Preflight
>    Affects Versions: 1.8.8, 2.0.0
>            Reporter: Tilman Hausherr
>         Attachments: empty_word.pdf
>
>
> Another one from the Bavaria test suite:
> {code}
> /CreationDate(D:20090317081112) 
> /ModDate(D:20090317081112)
> <xmp:CreateDate>2009-03-17T08:11:12Z</xmp:CreateDate>
> <xmp:ModifyDate>2009-03-17T08:11:12Z</xmp:ModifyDate>
> {code}
> The info dates do not have a timezone, but the xmp dates do (Z = "Zulu"). 
> This information (whether there was a timezone information in the string) is 
> "lost" in our conversion methods :-(
> Amusingly, PDF Tools says the file is valid.



--
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