docassemble
docassemble copied to clipboard
PDF not "decrypted" error
Hi, I am trying to output a filled PDF form but DA throws an unexpected error: PyPDF2.utils.PdfReadError: file has not been decrypted
at template compile.
This appears to be the same issue as this and/or this issue with the PyPDF2 lib.
I was able to fix this for the linked PDF with the qpdf "decrypt" hack mentioned in one of the links, which strongly suggests this is in fact the issue. Suggested fix is to include the code at the SO link to pre-check PDFs for "encryption" on upload to the templates folder.
See https://docassemble.org/docs/documents.html#template%20password
The code behind this feature uses qpdf
to do the "decryption." Templates like these are a special case of encrypted templates; the password just happens to be ""
.