Bottom Page

Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
 ReportLab
#1
I have 7 pages pdf file and I am trying to write on existing pdf file . I can write on the first page however I cannot write on the rest of pages  

self.canvas.save() 
            output = PdfFileWriter()
            self.packet.seek(0)

            new_pdf = PdfFileReader(self.packet)
          
            existing_pdf = PdfFileReader(open(filename,"rb"))
            for i in range(0,existing_pdf.getNumPages()):
                page = existing_pdf.getPage(0)
                page.mergePage(new_pdf.getPage(0))
                output.addPage(page)
            outputStream = open('/home/egor/destination.pdf',"wb")
            output.write(outputStream)
            outputStream.close()

Quote
#2
Have you seen this page: https://www.programcreek.com/python/exam...FileWriter
Quote
#3
I could not find any relevant examples from there
Quote

Top Page

Possibly Related Threads...
Thread Author Replies Views Last Post
  cyrillic symbols in tables in reportlab. hiroz 4 910 Mar-20-2019, 07:42 PM
Last Post: nilamo
  Python Reportlab Wordwrap Table Mady 0 1,203 Dec-18-2018, 06:31 AM
Last Post: Mady
  Reportlab Dynamic Table Q Gutt 0 1,550 Jun-13-2018, 10:18 PM
Last Post: Gutt
  Reportlab: Add xlabel, ylabel and grid to lineplot denissanga 2 1,996 Dec-19-2017, 04:48 PM
Last Post: denissanga
  Python ReportLab ek5442 6 3,301 Mar-15-2017, 07:47 PM
Last Post: ek5442

Forum Jump:


Users browsing this thread: 1 Guest(s)