overlay one pdf or ps file on top of another

前端 未结 9 1284
轻奢々
轻奢々 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 06:15

    You can do this with pdf files using the command line tool pdftk using the stamp or background option.

    e.g.

    $ pdftk file1.pdf background file2.pdf output combinedfile.pdf
    

    This will only work with a one-page background file. If you have multiple pages, you can use the multibackground command instead.

    0 讨论(0)
  • 2020-12-02 06:18

    PDFbox for Java supports a Overlay class which allows to merge PDFs this way. See this answer: Watermarking with PDFBox

    However, both PyPDF2 and PDFbox have been unreliable in my experience, but perhaps this is helpful for someone.

    0 讨论(0)
  • 2020-12-02 06:21

    You could convert both pdfs into images and overlay one on top of the other layer like.

    A suitable graphics library that you could use this would work.

    Watermark suggestion above has great potential too as long as you don't run into issues in your language or graphics/pdf library of choice.

    0 讨论(0)
提交回复
热议问题