I have 2 PDF files, each containing only one page, both pages are in same size and same orientation (landscape). I tried to use reportlab to merge theses 2 pages and save the result to a new pdf file. But the result is confusing. Each time I tried to merge, one of the pages is some how rotated by 90 degree.
Here is the code, does anybody know what I've done wrong:
base_pdf = PdfFileReader(open("base.pdf", "rb"))
hello_pdf = PdfFileReader(open("hello.pdf", "rb"))
new_pdf = PdfFileWriter()
base_page = base_pdf.getPage(0)
hello_page = hello_pdf.getPage(0)
base_page.mergePage(hello_page)
new_pdf.addPage(base_page)
outputStream = open("merged.pdf", "wb")
new_pdf.write(outputStream)
outputStream.close()