overlay one pdf or ps file on top of another

前端 未结 9 1316
轻奢々
轻奢々 2020-12-02 05:27

I have two pdf or postscript files (I can work with either one). What I want to do is merge each page on top of the other so that page1 of document A will be combined with

9条回答
  •  时光取名叫无心
    2020-12-02 05:58

    I had success solving this problem (PDF only and Python) by using pyPdf, specifically the mergePage operation.

    From the docs:

    # add page 4 from input1, but first add a watermark from another pdf:
    page4 = input1.getPage(3)
    watermark = PdfFileReader(file("watermark.pdf", "rb"))
    page4.mergePage(watermark.getPage(0))
    

    Should be enough to get the idea.

提交回复
热议问题