Hi Tom,
Yes quite right. As The Wanderer points out the CreationDate and ModDate
differ, as do the uuid in the Catalog Metadatas and the trailer ID.

I've found that deleting the optional dates from the Info dictionary, the
Metadata entry from the Catalog and resetting the ID does seem to be enough
to make output PDFs identical. In the simple case at least.

This gist https://gist.github.com/dwarring/1e4e056d84d6fe125262bba1da1f58fb
does
this using the Raku PDF module. Usage is:

p2s2pdf-strip.raku in.pdf [out.pdf]     # post-process ps2pdf output

I've used the lower level PDF::Reader interface, which doesn't often get
used directly. But in this case, we also need to bypass Raku PDF also
attempting to update the same fields. The PDF also needs to be rewritten,
rather than being incrementally updated.

Hope that works in this case.

Regards
David Warring

On Mon, Dec 14, 2020 at 10:14 AM Tom Browder <tom.brow...@gmail.com> wrote:

> On Sun, Dec 13, 2020 at 11:03 The Wanderer <wande...@fastmail.fm> wrote:
> > On 2020-12-13 at 11:40, Tom Browder wrote:
> > > personalized calendar for my wife. This year I have been cleaning up
> > > my old Perl generating code (in preparation for converting it to Raku
> > > [https://raku.org]) and noticed I am getting a different pdf output
> > > for each run, even when the PS output source file is unchanged!
> ...
> > What observation leads you to notice that the files are different?
>
> When I have both files under git revision control and committed, a
> rerun shows no change in the PS but a change in the PDF.
>
> I read the rest of this post and your additional post. Thank you for
> your forensic information. As long as I know what has changed, thanks
> to you, I am content for the moment.
> I have a Raku online friend (in CC above) who is an expert on PDF and
> has built voluminous tools with his PDF modules in Raku. I think he
> will either know about the problem or possibly know how to fix it
> since he deals with the binary output and modifying it after the fact.
>
> Have a very Happy New Year!
>
> Cheers,
>
> - Tom
>
> P.S. I wasn't aware of vbindiff (or maybe I forgot).
>

Reply via email to