datamade / councilmatic-document-merger

📚 A Docker image that compiles specified remote documents into a single PDF packet
1 stars 0 forks source link

Handle "encrypted" PDFs #2

Closed hancush closed 2 years ago

hancush commented 2 years ago

Sometimes, a document's metadata indicates that it's encrypted, even though it doesn't require a password. This causes pdfunite to fail.

[2021-10-25 19:14:23,114] {docker.py:263} INFO - pdfunite attachments/2086_A_Finance2C_Budget_and_Audit_Committee_21-07-14_Agenda.pdf attachments/board_report_7812.pdf attachments/3483651f-55f3-4f95-b005-e8649ee70e3e.pdf attachments/74dd2990-32b1-4d97-a96d-16aeb648e826.pdf attachments/board_report_7837.pdf attachments/48c87bb8-4129-460a-a2fa-b7e84957045e.pdf attachments/19f89300-ac83-4ea3-bdde-f465eb8e4196.pdf merged/finance-budget-and-audit-committee-0438e80771e6.pdf
[2021-10-25 19:14:23,125] {docker.py:263} INFO - Unimplemented Feature: Could not merge encrypted files ('attachments/48c87bb8-4129-460a-a2fa-b7e84957045e.pdf')
[2021-10-25 19:14:23,126] {docker.py:263} INFO - make: *** [Makefile:12: merged/finance-budget-and-audit-committee-0438e80771e6.pdf] Error 255

Example of encrypted document

Some ideas: https://stackoverflow.com/questions/62795612/poppler-pdfunite-cannot-merge-encrypted-pdf-files-how-to-remove-encryption-no