May-04-2021, 06:58 AM
(This post was last modified: May-04-2021, 09:54 AM by Larz60+.
Edit Reason: added code tags
)
Hi All
Using Pypdf2 IM trying to resize pdf page from existing(549,749) size to new size 2308,3500 able to resize the page but not text accordingly. I need text also to be resize along with the page
below is the code I used:
Using Pypdf2 IM trying to resize pdf page from existing(549,749) size to new size 2308,3500 able to resize the page but not text accordingly. I need text also to be resize along with the page
below is the code I used:
import PyPDF2 pdfFileObj = open(path, 'rb') pdfReader = PyPDF2.PdfFileReader(pdfFileObj) pageObj = pdfReader.getPage(0) pageObj.mediaBox pageObj.scaleTo(2308,3500) writer = PyPDF2.PdfFileWriter() writer.addPage(pageObj) with open(r"intput", "wb+") as f: writer.write(f) pdfFileObj.close()