Merge pull request #38550 from AarDG10/fix-pdf

fix(print_utils): fix pdf rendering via chrome by considering bytes
This commit is contained in:
Ejaaz Khan 2026-04-13 12:23:32 +05:30 committed by GitHub
commit c6b0587f3b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -95,6 +95,15 @@ def get_print(
)
# if hook returns a value, assume it was the correct pdf_generator and return it
if pdf:
if output and isinstance(pdf, bytes):
from io import BytesIO
from pypdf import PdfReader
reader = PdfReader(BytesIO(pdf))
for page in reader.pages:
output.add_page(page)
return output
return pdf
for hook in frappe.get_hooks("on_print_pdf"):