pdfbox-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF subversion and git services (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (PDFBOX-4292) Validation fails if ModifyDate and ModDate are specified using different time zones
Date Wed, 22 Aug 2018 19:32:00 GMT

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

ASF subversion and git services commented on PDFBOX-4292:
---------------------------------------------------------

Commit 1838677 from tilman@apache.org in branch 'pdfbox/branches/2.0'
[ https://svn.apache.org/r1838677 ]

PDFBOX-4292: compare calendar objects instead of ISO 8601 values to avoid false differences
when time zones are different, as suggested by Alonso Gonzalez; set milliseconds to 0 in test
for xmp values because these milliseconds are kept, but not in COS values; add a test

> Validation fails if ModifyDate and ModDate are specified using different time zones
> -----------------------------------------------------------------------------------
>
>                 Key: PDFBOX-4292
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-4292
>             Project: PDFBox
>          Issue Type: Bug
>          Components: Preflight
>    Affects Versions: 2.0.11
>            Reporter: Alonso Gonzalez
>            Priority: Major
>         Attachments: Test 2.pdf
>
>
> I have a test PDF with this metadata:
> {quote}/ModDate (D:20180817115837+02'00')
>  <xmp:ModifyDate>2018-08-17T09:58:37Z</xmp:ModifyDate>
> {quote}
>  
> According to the specification this is valid and should be considered as equivalent:
> {quote}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.
> EXAMPLE The document information dictionary entries:
> /CreationDate (D:20040402)
> /ModDate (D:200404080+91132-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}
>  
> In org.apache.pdfbox.preflight.metadata.SynchronizedMetaDataValidation#analyzeModifyDateProperty
the calendar objects are formatted as strings and then compared:
> {code:java}
> else if(!DateConverter.toISO8601(xmpModifyDate).equals(DateConverter.toISO8601(modifyDate)))
{
>   ve.add(this.unsynchronizedMetaDataError("ModificationDate"));
> }
> {code}
> In my testcase DateConverter.toISO8601(modifyDate) yields "2018-08-17T11:58:37+02:00"
while DateConverter.toISO8601(xmpModifyDate) yields "2018-08-17T09:58:37+00:00". These timestamps
are semantically equal (xmpModifyDate.compareTo(modifyDate) yields 0) and therefore the PDF
should be considered as valid PDF-A1b.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@pdfbox.apache.org
For additional commands, e-mail: dev-help@pdfbox.apache.org


Mime
View raw message