Submit Your Article Forum Rules

Page 1 of 2 12 LastLast
Results 1 to 10 of 11

Thread: How To I Use PDF Templates In PHP?

  1. #1
    Junior Member
    Join Date
    Sep 2007
    Posts
    1

    How To I Use PDF Templates In PHP?

    I have about twenty small pdf files business card design templates that I want to be able to populate with data from a MySQL database name, phone number, etc and output to the browser/save to the server. The format has to be PDF or another vector format suitable for direct to print use. I have been goggling looking for a simple way to do it and am coming up short. I can not just replace strings in the document because of the way for the format works. Has anyone ever done anything like this before or do I have to hard code the layout of each free templates into my application.
    Thanks

  2. #2
    WebProWorld MVP Orion's Avatar
    Join Date
    Sep 2003
    Location
    Halton Hills, Ontario
    Posts
    707

    Re: How To I Use PDF Templates In PHP?

    To my knowledge you cannot update a PDF dynamically like that on the web... HOWEVER...
    You can use flash to create and pull data from the database to create the PDF and you can also use HTML2PDF. The later I believe would require you to create the document in HTML (PHP) populate it with the data then use the HTML2PDF to create the final product.

    I don't know how to do it but I think that Flash might be your best route there...

    There is also a (new to me anyway) product from Adobe called LiveCycle designer which on a glance appears to create pdf's dynamically from a database not sure if it has online functionality...

    Let us know here which solution you end up using and the pros and cons, I think it's definitely an awesome idea, and could be of great value to many of us here.

  3. #3
    WebProWorld MVP
    Join Date
    Aug 2003
    Posts
    1,021

    Re: How To I Use PDF Templates In PHP?

    You can use FPDF to generate a PDF from scratch from within PHP, but I don't know of a way to populate an existing PDF.

  4. #4

    Re: How To I Use PDF Templates In PHP?

    Yes this is totally possible with FPDF we've used it many times to do what you looking for.

    If your looking for some help or need a hand in coding then please let us know.

  5. #5
    WebProWorld MVP mikmik's Avatar
    Join Date
    Aug 2003
    Posts
    1,525

    Re: How To I Use PDF Templates In PHP?

    Generate PDFs with PHP

    This is an excellent site - Class: classPdf (pdf) - PHP Classes

    Also, if you generate xml code, you can display it in any format you want. This takes knowledgeof xslt and schema's, however, but your code can be served in any format including for smart phones, or direct input into a Db, nomatter which kind
    Babies don't need a vacation, but I still see them at the beach... it pisses me off! I'll go over to a little baby and say 'What are you doing here? You haven't worked a day in your life!'
    Steven Wright

  6. #6
    Senior Member chadhaajay's Avatar
    Join Date
    Dec 2003
    Posts
    152

    Smile Re: How To I Use PDF Templates In PHP?

    Yes, It is completely possible to generate PDF files on the fly in your server side scripts however the information is quite limited when it comes to updation of existing PDF documents. Have a look at the following article which has information and various tools to generate PDF files in PHP.

    Generate PDF files in PHP - HTML to PDF Conversion

    Sincerely,

    Ajay Chadha (Director)
    Chadha Software Technologies

  7. #7
    Senior Member chadhaajay's Avatar
    Join Date
    Dec 2003
    Posts
    152

    Re: How To I Use PDF Templates In PHP?

    Since it is possible to convert HTML code to PDF using the information provided at the link below so I'd suggest you to keep the templates of your business cards in HTML format and when the data is updated then generate PDF of that HTML format.

    Generate PDF files in PHP - HTML to PDF Conversion

    Sincerely,

    Ajay Chadha (Director)
    Chadha Software Technologies

  8. #8
    Junior Member
    Join Date
    Oct 2007
    Posts
    1

  9. #9
    Junior Member
    Join Date
    Feb 2008
    Posts
    1

    Re: How To I Use PDF Templates In PHP?

    UK company Iceni has technology called InfixServer that will take PDF template documents then populate with either text, images or PDF files. Server based riven by an XML interface - so easy to generate from PHP.
    See Untitled Document

    Note - I sometimes work with Iceni which is why I have an Iceni e-mail address.

  10. #10
    Senior Member
    Join Date
    Aug 2005
    Posts
    163

    Re: How To I Use PDF Templates In PHP?

    You use FPDF for solving your problem.

Similar Threads

  1. Free Web Templates
    By MrLeN in forum Submit Your Site/Logo For Review
    Replies: 4
    Last Post: 04-11-2005, 07:46 AM
  2. Slicing Templates
    By WPW_Feedbot in forum Graphics & Design Discussion Forum
    Replies: 0
    Last Post: 02-15-2005, 08:31 PM
  3. How do you make templates
    By random_cam in forum Web Programming Discussion Forum
    Replies: 6
    Last Post: 01-31-2005, 03:45 AM
  4. Blogger Templates
    By arpecop in forum Submit Your Site/Logo For Review
    Replies: 1
    Last Post: 01-16-2005, 08:38 PM
  5. www.web-templates.se
    By hernlind in forum For Sale/For Hire
    Replies: 0
    Last Post: 12-09-2004, 03:28 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •