Skip to content

when adding new pages to file as cropped boxes from one page i get all pages of the same look #455

@Swartor

Description

@Swartor

I hav code like so and i get in new pdf file 3 pages but all looks the same as the last croped box. Why i cant get 3 difrent pages ??

from PyPDF2 import PdfFileWriter, PdfFileReader

output = PdfFileWriter()
input1 = PdfFileReader(open("input.pdf", "rb"))
page = input1.getPage(0)
for y in range(0,3):
	page.cropBox.lowerRight = (205+185, 612)
	page.cropBox.upperLeft = (20+185, 752)
	output.addPage(page)
	
outputStream = open("output.pdf", "wb")
output.write(outputStream)
outputStream.close()

Metadata

Metadata

Assignees

No one assigned

    Labels

    is-maintenanceAnything that is just internal: Simplifying code, syntax changes, updating docs, speed improvementsnf-documentationNon-functional change: Documentation

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions