Compare commits

...
Author SHA1 Message Date
Trenton H 3fa47fb7a2 Chore: copy PDFs on disk instead of reading them into memory 2026-11-26 15:12:18 -08:00
2 changed files with 2 additions and 2 deletions

No files matched your search

+1 -1
View File
@@ -566,7 +566,7 @@ class MailDocumentParser:
# If no HTML content, create the PDF from the message.
# Otherwise, create 2 PDFs and merge them with Gotenberg.
if not mail_message.html:
archive_path.write_bytes(mail_pdf_file.read_bytes())
shutil.copyfile(mail_pdf_file, archive_path)
else:
pdf_of_html_content = self.generate_pdf_from_html(
mail_message.html,
+1 -1
View File
@@ -443,7 +443,7 @@ class RasterisedDocumentParser:
self.log.warning(
f"PDF/A metadata stamping failed ({e!s}); falling back to plain PDF.",
)
pdfa_path.write_bytes(plain_pdf_path.read_bytes())
shutil.copyfile(plain_pdf_path, pdfa_path)
return pdfa_path