stlehmann / pdftools

small collection of python scripts for pdf manipulation
MIT License
93 stars 18 forks source link

easy fixes for PyPDF2 3.0.0 support #22

Open cjfp opened 12 months ago

cjfp commented 12 months ago

On my system pdftools is installed at:

/usr/local/lib/python3.8/site-packages/pdftools/pdftools.py

If I edit this file as follows:

s/PdfFileReader/PdfReader/g
s/PdfFileWriter/PdfWriter/g
s/addPage/add_page/g

then the deprecation errors I get from PyPDF2 3.0.0 go away and things work as expected when merging PDFs (so far). There might be other updates required, of course, but hopefully find and replace is sufficient.

Note: there is an open pull request that also includes these fixes, as well as a move from PyPDF2 to pypdf. So the point of this issue is just to document a quick local workaround.