fix PyPDF2 3.x page copying + rename documentation

- Added explicit page copying after cloneReaderDocumentRoot() calls
- Renamed PATCH_PDFWRITER.md to PATCH_PYPDF2_PDFWRITER.md
- Prevents 327-byte empty PDFs in PyPDF2 3.x

🤖 assisted by claude
This commit is contained in:
Ernad Husremovic 2025-09-02 19:31:40 +02:00
parent 30497b379e
commit b775aae34e
2 changed files with 4 additions and 1 deletions

View file

@ -5,7 +5,10 @@ from base64 import b64decode
from io import BytesIO
from logging import getLogger
from PyPDF2 import PdfFileReader, PdfFileWriter
try:
from PyPDF2 import PdfWriter as PdfFileWriter, PdfReader as PdfFileReader
except ImportError:
from PyPDF2 import PdfFileWriter, PdfFileReader
from odoo import _, api, fields, models