[ https://issues.apache.org/jira/browse/FOP-3367 ]
Juan Manuel Méndez Rey deleted comment on FOP-3367:
---------------------------------------------
was (Author: JIRAUSER315370):
Thanks.
Two versions, please pick one:
* FOP-3367-metadata-only.patch,
[apache/xmlgraphics-fop#133|https://github.com/apache/xmlgraphics-fop/pull/133]:
only xmp:MetadataDate. The file ID is not touched.
* FOP-3367-v3.patch,
[apache/xmlgraphics-fop#132|https://github.com/apache/xmlgraphics-fop/pull/132]:
the same, plus an opt in PDF renderer option, file-id-from-creation-date,
default false. Only with it enabled does the file ID use the creation date set
on the user agent.
The second one is what fixes reproducible builds for distributions, which build
documentation with FOP: without it the file ID differs on every run, so the API
route suggested in FOP-2854 never gives the same PDF twice, and distributions
keep their own patches.
On the spec: the current time is a "should" in ISO 32000-1 14.4, listed "to
help ensure the uniqueness of file identifiers", and the note 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." The default stays as
the spec recommends, and with the option the ID still depends on the content.
> 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
>
> [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)