Skip to content
Snippets Groups Projects

Fix page count on some PDF files, and fix a Python 3 incompatibility

Closed O2 Graphics requested to merge O2Graphics/mayan-edms:fix-PDF-page-count into master

The page count was working on most of my PDF files, but I got a "EOF marker not found" error on one of them. This error is well known in PyPDF2, but this library isn't maintained anymore: https://github.com/mstamy2/PyPDF2/issues/177

So, I've used pdfinfo to count pages in case we encounter this error. While here, the code to call pdfinfo was already present, so I moved it in a function. I also had to call list(filter(...)), because just filter(...) wasn't working in Python 3 ( https://diveintopython3.problemsolving.io/porting-code-to-python-3-with-2to3.html#filter )

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
Please register or sign in to reply
Loading