Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Temporary hacky workaround for using the deprecated PdfFileReader #3

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions PDF Trimmer/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,16 @@ Make sure you have installed `PyPDF2` in your python environment. If not, simply
```
pip install PyPDF2
```
**Note**: As of April 29th, 2023, PdfFileReader had been removed from PyPDF2 3.0.0.

One hacky workaround until this is fixed is to use virtual environment:
```
python -m venv venv # Set up virtual environment "venv"
source venv/bin/activate # Enter virtual environment.
pip install PyPDF2=2.12.1 # Install an old version of PyPDF2
python pdf_trimmer.py ~/Downloads/so_bulky.pdf light_as_feather.pdf
deactivate # Should you wish to leave the virtual environment.
```

## Why I needed to create something like this/ Why you may need it?
I was taking a Statistics course on Coursera and they have this option to download the slides being used in videos as PDFs. Hence these PDFs had this problem because of the animations in slides as I explained above. But not any longer!
Expand Down