I'm having trouble merging two PDF files with pyPdf. When I run the following code the the watermark (page1) looks fine, but the page2 has been rotated 90 degrees clockwise.
Any ideas what's going on?
from pyPdf import PdfFileWriter, PdfFileReader
# PDF1: A4 Landscape page created in photoshop using PdfCreator,
input1 = PdfFileReader(file("base.pdf", "rb"))
page1 = input1.getPage(0)
# PDF2: A4 Landscape page, text only, created using Pisa (www.xhtml2pdf.com)
input2 = PdfFileReader(file("text.pdf", "rb"))
page2 = input2.getPage(0)
# Merge
page1.mergePage(page2)
# Output
output = PdfFileWriter()
output.addPage(page1)
outputStream = file("output.pdf", "wb")
output.write(outputStream)
outputStream.close()
pisaContext instance has no attribute 'seek'
– Vange