pass deterministic_id=True to writer.save() for pikepdf >= 6.2.0

Closes: #150
This commit is contained in:
Johannes Schauer Marin Rodrigues 2022-10-16 14:13:22 +02:00
parent 10c6901fa3
commit be8369373f
Signed by untrusted user: josch
GPG key ID: F2CBA5C78FBD83E1

View file

@ -1259,8 +1259,11 @@ class pdfdoc(object):
# now write out the PDF
if self.engine == Engine.pikepdf:
kwargs = {}
if pikepdf.__version__ >= "6.2.0":
kwargs["deterministic_id"] = True
self.writer.save(
outputstream, min_version=self.output_version, linearize=True
outputstream, min_version=self.output_version, linearize=True, **kwargs
)
elif self.engine == Engine.pdfrw:
self.writer.trailer.Info = self.writer.docinfo