<Ч
Size: a a a
<Ч
Д
<Ч
<Ч
Д
T
from PyPDF2 import PdfFileWriter, PdfFileReader
with open("/home/backhub/PycharmProjects/PDFParser/fol/e084_1.pdf", "rb") as in_f:
input1 = PdfFileReader(in_f)
output = PdfFileWriter()
numPages = input1.getNumPages()
print("document has %s pages." % numPages)
for i in range(numPages):
page = input1.getPage(i)
print(page.mediaBox.getUpperRight_x(), page.mediaBox.getUpperRight_y())
page.trimBox.lowerLeft = (250, 250)
page.trimBox.upperRight = (225, 225)
page.cropBox.lowerLeft = (10, 270)
page.cropBox.upperRight = (1000, 775)
output.addPage(page)
with open("out.pdf", "wb") as out_f:
output.write(out_f)
ᅠ
l
ЖК
¯
ЖК
from PyPDF2 import PdfFileWriter, PdfFileReader
with open("/home/backhub/PycharmProjects/PDFParser/fol/e084_1.pdf", "rb") as in_f:
input1 = PdfFileReader(in_f)
output = PdfFileWriter()
numPages = input1.getNumPages()
print("document has %s pages." % numPages)
for i in range(numPages):
page = input1.getPage(i)
print(page.mediaBox.getUpperRight_x(), page.mediaBox.getUpperRight_y())
page.trimBox.lowerLeft = (250, 250)
page.trimBox.upperRight = (225, 225)
page.cropBox.lowerLeft = (10, 270)
page.cropBox.upperRight = (1000, 775)
output.addPage(page)
with open("out.pdf", "wb") as out_f:
output.write(out_f)
¯
ЖК
<Ч
AM
ᅠ