0

I want to create each page of a pdf file to a new pdf object. I am following the mentioned code snippet https://stackoverflow.com/a/490203/13291630 but here it is shown as the creation of a new file, but I want to just create a pdf object without creating a new file and just use that created pdf object as every other pdf. I hope this information helps, Can anyone help me out here.

1 Answer 1

1

If I understand correctly your purpose:

import pdfplumber
filename = 'path/to/your/PDF'
pages = []
with pdfplumber.open(filename) as pdf:
    for i, page in enumerate(pdf.pages):
        pages.append(page)

The list pages will contain an element of class page for every actual page of you PDF. You can then access their properties. Look at PDFPlumber Github page for more information

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.