Join us and get access to hundreds of tutorials and a community of expert Pythonistas.

Unlock This Lesson

This lesson is for members only. Join us and get access to hundreds of tutorials and a community of expert Pythonistas.

Unlock This Lesson

Hint: You can adjust the default video playback speed in your account settings.
Hint: You can set the default subtitles language in your account settings.
Sorry! Looks like there’s an issue with video playback 🙁 This might be due to a temporary outage or because of a configuration issue with your browser. Please see our video player troubleshooting guide to resolve the issue.

Extracting Metadata and Rotating Pages

Now that we have the PyPDF package installed, let’s take a look at how to extract document metadata and begin to manipulate PDFs, starting with page rotation.

You can check out the following resources:

rolandgarceau on Feb. 26, 2020

Where is the deep-dive for the explanation on the python interpreter from @4:15 in the video?

Chris Bailey RP Team on Feb. 26, 2020

Hi @rolandgarceau, The link that Andrew is referencing @4:15 is the one in called “Defining Main Functions in Python”.

Phil M on Feb. 26, 2020

Thank you, I had that same question. :)

mikesult on Feb. 29, 2020

I think line 7 should read

pdf_reader = PdfFileReader(pdf_path)

instead of

pdf_reader = PdfFileReader(path)

since the parameter passed in to rotate_pages() was named ‘pdf_path’.

It works as written but I think it’s because ‘path’ from the if name == ‘main‘ section is available to rotate_pages() in this situation.

Is this correct?

Chris Bailey RP Team on March 1, 2020

Hi @mikesult, You are correct on both accounts. If you were to import this file as a module and try to use rotate_pages('Juypter_Notebook_An_Introduction.pdf') it would fail as path is not defined. I will mention this to the team. Thanks.

gracetan on May 6, 2020

Hi Chris, I am thinking how can i find the edited documents? for example, if i rotated the documents, i want to see the updated documents.

Become a Member to join the conversation.