docassemble icon indicating copy to clipboard operation
docassemble copied to clipboard

PDF not "decrypted" error

Open francisjervis opened this issue 4 years ago • 1 comments

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.

francisjervis avatar Aug 02 '20 07:08 francisjervis

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 "".

jhpyle avatar Aug 02 '20 15:08 jhpyle