From 9f95bf31e4ed751f23b2ad0c684e2e807cc9c000 Mon Sep 17 00:00:00 2001 From: Harry Karvonen Date: Thu, 14 Jul 2022 10:08:18 +0300 Subject: [PATCH] Make sure that PageObject is not deduplicated if it is not exactly same page object. --- PyPDF2/_page.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/PyPDF2/_page.py b/PyPDF2/_page.py index 08df68569..340ee8d15 100644 --- a/PyPDF2/_page.py +++ b/PyPDF2/_page.py @@ -244,6 +244,11 @@ def __init__( self.pdf: Optional[PdfReader] = pdf self.indirect_ref = indirect_ref + def hash_value_data(self) -> bytes: + data = super().hash_value_data() + data += b"%d" % id(self) + return data + @staticmethod def create_blank_page( pdf: Optional[Any] = None, # PdfReader