Juan Manuel Méndez Rey created FOP-3367:
-------------------------------------------

             Summary: Creation date set on FOUserAgent is not used for 
xmp:MetadataDate and the file ID
                 Key: FOP-3367
                 URL: https://issues.apache.org/jira/browse/FOP-3367
             Project: FOP
          Issue Type: Bug
          Components: renderer/pdf
    Affects Versions: 2.12
            Reporter: Juan Manuel Méndez Rey
         Attachments: 
0001-FOP-Use-the-user-agent-creation-date-for-MetadataDate-and-file-ID.patch

[PATCH]

When a creation date is set with FOUserAgent.setCreationDate(), FOP uses it for 
/CreationDate and xmp:CreateDate, but xmp:MetadataDate and the date hashed into 
the trailer /ID still come from the clock. So two runs with the same input and 
the same creation date give different PDFs.

In FOP-2854 the advice was to set the dates through the FOP API. This patch 
makes the API date apply everywhere. It adds no environment variable or new 
option.
 * IFRenderer and PDFRenderingUtil: MetadataDate is the creation date when one 
is set, the current time otherwise.
 * FileIDGenerator: hashes the document creation date instead of the current 
time.
 * New test PDFCreationDateTestCase: renders the same FO twice with a fixed 
creation date. Both cases fail on main (1301bcf) and pass with the patch.

When no creation date is set, nothing changes. The full fop-core suite passes 
(3731 tests) and checkstyle reports no violations.

Pull request: [https://github.com/apache/xmlgraphics-fop/pull/132]

Related: FOP-2854, FOP-3040, 
[https://github.com/apache/xmlgraphics-fop/pull/65] and 
[https://github.com/apache/xmlgraphics-fop/pull/87] (its first two commits, by 
t-8ch, cover the same two places).



--
This message was sent by Atlassian Jira
(v10.3.26#10030026)

Reply via email to