Adding an image to a pdf with pdftk

前端 未结 4 1911
走了就别回头了
走了就别回头了 2021-01-31 11:36

Hello I am using pdftk to generate a PDF based on a form that is submitted.

I have everything working fine until here. Which is adding an image of a signature. I am usi

4条回答
  •  时光说笑
    2021-01-31 11:54

    First convert the image to PDF

    convert image.png image.pdf
    

    Then scale up and offset the image using pdfjam (another free tool)

    pdfjam --paper 'a4paper' --scale 0.3 --offset '7cm -12cm' image.pdf
    

    Then combine both PDFs using pdftk

    pdftk text.pdf stamp image.pdf output combined.pdf
    

    You may need to download STAMPtk if you need to position the image and add it to only one page in the general PDF, but this one you have to pay for it.

    You can download STAMPtk from here http://www.pdflabs.com/tools/stamptk-the-pdf-stamp-maker/

    I hope it helps!

提交回复
热议问题