I have been looking for a solution for this problem : I have two landscape-oriented A3 pdfs with images and I want to overlay them in a manner that the resulting pdf contains both images merged into one as if one of them was a watermark, but with the same density. Think of it as if about printing two different pdfs on one A3 sheet of paper, I want to get exactly that effect.
In other words - just came up with a way to express it - I would like to overlay two pdfs and for the upper layer, make all the "white" area transparent.
Basically, I just followed steps in any solution from this question:
overlay one pdf or ps file on top of another
The pdftk didn't work in my case. The resulting PDF displayed the pdf that was on the top layer, but the bottom layer was not seen. So, I proceeded to programming solution and downloaded pyPdf.
The code from the site was exactly an implementation of the desired solution:
from pyPdf import PdfFileReader,PdfFileWriter
output = PdfFileWriter()
input1 = PdfFileReader(file("b.pdf", "rb"))
page1 = input1.getPage(0)
watermark = PdfFileReader(file("a.pdf", "rb"))
page1.mergePage(watermark.getPage(0))
output.addPage(page1)
outputStream = file("c.pdf", "wb")
output.write(outputStream)
outputStream.close()
However, the result was the same as after using pdftk.
What am I doing wrong? Maybe this is not pdf merging, multimerging, stamping, overlaying etc but something else? If so, how is it called?