Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
PyPDF2 processing problem
#7
Photo 
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:

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()
Reply


Messages In This Thread
PyPDF2 processing problem - by Pavel_47 - Nov-11-2019, 04:52 PM
RE: PyPDF2 processing problem - by Larz60+ - Nov-11-2019, 06:07 PM
RE: PyPDF2 processing problem - by Pavel_47 - Nov-11-2019, 06:28 PM
RE: PyPDF2 processing problem - by Larz60+ - Nov-11-2019, 10:21 PM
RE: PyPDF2 processing problem - by Pavel_47 - Nov-12-2019, 08:33 AM
RE: PyPDF2 processing problem - by Larz60+ - Nov-12-2019, 12:35 PM
RE: PyPDF2 processing problem - by chaitanya - May-04-2021, 06:58 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  PyPDF2 deprecation problem gowb0w 5 4,164 Sep-21-2023, 12:38 PM
Last Post: Pedroski55
  ModuleNotFoundError: No module named 'PyPDF2' Benitta2525 1 1,536 Aug-07-2023, 05:32 AM
Last Post: DPaul
  Pypdf2 will not find text standenman 2 948 Feb-03-2023, 10:52 PM
Last Post: standenman
  pyPDF2 PDFMerger close pensding file japo85 2 2,440 Jul-28-2022, 09:49 AM
Last Post: japo85
  Array problem in pylab module - Image processing bobfat 0 1,724 Dec-31-2019, 06:02 PM
Last Post: bobfat
  Problem with installing PyPDF2 Pavel_47 2 6,046 Nov-10-2019, 02:58 PM
Last Post: Pavel_47
  pyPDF2 nautilus columns modification AJBek 1 2,922 Jun-07-2019, 04:17 PM
Last Post: micseydel
  Using Pypdf2 write a string to a pdf file Pedroski55 6 20,351 Apr-11-2019, 11:10 PM
Last Post: snippsat
  Merging pdfs with PyPDF2 Pedroski55 0 3,296 Mar-07-2019, 11:58 PM
Last Post: Pedroski55
  PyPDF2 encrypt Truman 3 5,450 Jan-19-2019, 12:18 AM
Last Post: snippsat

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020