mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2026-11-27 07:25:16 +00:00
Chore: copy PDFs on disk instead of reading them into memory
This commit is contained in:
1 parent
5c399653d7
commit
3fa47fb7a2
2 files changed
+2
-2
No files matched your search
@@ -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,
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
Reference in new issue
Block a user