Writing/Drawing over a PDF template document in PHP

前端 未结 3 1454
南方客
南方客 2020-12-07 18:53

I\'d like to be able to write/overlay text over an existing pdf document using PHP. What I am hoping to do is have a pdf document that can act as a template, and fill in the

相关标签:
3条回答
  • 2020-12-07 19:14

    When you want to use PDF lib to write over a document, positionning is time consuming and boring. Dhek is useful for such task: https://github.com/cchantep/dhek/releases .

    JSON mapping over PDF page/coordinates is defined, so that you can write with PDF API you prefer.

    0 讨论(0)
  • 2020-12-07 19:32

    Have a look at the FPDI Library an add on to FPDF for template annotation.

    It can also bolt-on to TCPDF, another popular PHP PDF library. An existing PDF is used as the base of a page, instead of a blank, after that the procedures are the same as regular PDF creation.

    0 讨论(0)
  • 2020-12-07 19:32

    You probably want to use PDF Forms for what you want to do. To fill these babies you could use the FDF method described here: Using HTML forms to fill in PDF fields with PHP and FDF.
    There is actually another nice SO post about PDF form filling here: Filling PDF Forms with PHP.

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