for i in range(numPages):
    page = input1.getPage(i)
print(page.mediaBox.getUpperRight_x(), page.mediaBox.getUpperRight_y())
page.trimBox.lowerLeft = 25, 25
page.trimBox.upperRight = 225, 225
page.cropBox.lowerLeft = 50, 50
page.cropBox.upperRight = 200, 200
output.addPage(page)
outputStream = file('out.pdf', 'wb')
output.write(outputStream)
outputStream.close()
Cropping pages of a .pdf file