From 30d705f0208ee72357f7fc47699e866de5aeea95 Mon Sep 17 00:00:00 2001 From: Johannes Schauer Marin Rodrigues Date: Sun, 28 Nov 2021 16:55:42 +0100 Subject: [PATCH] src/img2pdf.py: the /OpenAction array must contain the page as an indirect object --- src/img2pdf.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/img2pdf.py b/src/img2pdf.py index 973a923..1a3b7c9 100755 --- a/src/img2pdf.py +++ b/src/img2pdf.py @@ -1106,6 +1106,10 @@ class pdfdoc(object): [initial_page, PdfName.XYZ, NullObject, NullObject, 0] ) + # the /OpenAction array must contain the page as an indirect object + if self.engine == Engine.pikepdf: + initial_page = self.writer.make_indirect(initial_page) + if self.magnification == Magnification.fit: catalog[PdfName.OpenAction] = PdfArray([initial_page, PdfName.Fit]) elif self.magnification == Magnification.fith: