[
https://issues.apache.org/jira/browse/FOP-3367?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18137306#comment-18137306
]
Juan Manuel Méndez Rey commented on FOP-3367:
---------------------------------------------
Although looking deeper into the specification, the current time is a "should"
in ISO 32000-1 14.4, listed "to help ensure the uniqueness of file
identifiers", and the note right after the list says: "The calculation of the
file identifier need not be reproducible; all that matters is that the
identifier is likely to be unique."
FOP already leaves out the file location from that same list (see the comment
in DigestFileIDGenerator).
Without this, setCreationDate(), the API route suggested in FOP-2854, still
cannot give a reproducible PDF.
If you prefer, I can make this opt-in with a configuration option instead. What
do you think?
> 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
> Priority: Major
> Attachments: FOP-3367-v2.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)