Web Analytics Made Easy -
StatCounter Use PDF as a Template in PHP (eg mail merge) - CodingForum

Announcement

Collapse
No announcement yet.

Use PDF as a Template in PHP (eg mail merge)

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Use PDF as a Template in PHP (eg mail merge)

    Hi all,

    A great feature I would like to be able to implement in an online timesheet system I am working on for a recruitment agency is a "Print Timesheet to PDF" button. I want to be able to use the PDF document below as a template, and change the text in the PDF to something generated by PHP (or if PHP does not offer me that functionality, a different programming language).

    http://www.dylanlindgren.com/storage/timesheet.pdf

    Does anyone know a way to do this? I have breifly tried both FPDF and FPDI but both do not seem to allow me to edit text already in a PDF document.

    In essence, what I am trying to do is "mail merge" some data I have stored in a variable in PHP into places on this template timesheet.

    Any input will be greatly appreciated.
    Dylan.

  • #2
    you basically want to populate a pdf form?

    i always dynamicall create the complete pdf form (which can then include data from whatever source) --> you can apply a layouttemplate.
    just post back if you would be interested in taking this direction.
    Posting guidelines I use to see if I will spend time to answer your question : http://www.catb.org/~esr/faqs/smart-questions.html

    Comment


    • #3
      Originally posted by raf View Post
      you basically want to populate a pdf form?

      i always dynamicall create the complete pdf form (which can then include data from whatever source) --> you can apply a layouttemplate.
      just post back if you would be interested in taking this direction.
      Hi raf thanks for your reply. I actually got it working, although I wasn't able to "mail merge" I had to do as you said and recreate the whole document dynamically. I used FPDF to create it.

      Thanks again,
      Dylan.

      Comment


      • #4
        what's exactly the problem regarding the mail merge?
        you'll just have your fixed pdf content with some variables in. and when you loop though your recordset, you just assign values to these variables. (just like when you are creating html).
        Posting guidelines I use to see if I will spend time to answer your question : http://www.catb.org/~esr/faqs/smart-questions.html

        Comment

        Working...
        X