Merge pull request #38550 from AarDG10/fix-pdf
fix(print_utils): fix pdf rendering via chrome by considering bytes
This commit is contained in:
commit
c6b0587f3b
1 changed files with 9 additions and 0 deletions
|
|
@ -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"):
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue