Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 7 of 7
  1. #1
    New Coder
    Join Date
    Jan 2010
    Location
    Cardiff, UK
    Posts
    24
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Creating PDF docs with PHP

    Can anybody recommend a good free, reliable and robust PDF creation package?
    The choices seem to be:
    DOM PDF
    FPDF
    TCPDF and
    HARU.
    If anybody has any experience with any of these and can recommend or warn me against, it would be very helpful.
    Thanks in advance.

  • #2
    Senior Coder timgolding's Avatar
    Join Date
    Aug 2006
    Location
    Southampton
    Posts
    1,519
    Thanks
    114
    Thanked 110 Times in 109 Posts
    I'm having a go at doing this myself. Going to try dompdf for now. I'll let you know if it works
    You can not say you know how to do something, until you can teach it to someone else.

  • #3
    Regular Coder
    Join Date
    May 2009
    Posts
    425
    Thanks
    3
    Thanked 62 Times in 61 Posts
    FPDF works great for me! With a little effort in placing text/images on the page, it does pretty much everything I need it to.

  • #4
    Senior Coder timgolding's Avatar
    Join Date
    Aug 2006
    Location
    Southampton
    Posts
    1,519
    Thanks
    114
    Thanked 110 Times in 109 Posts
    dompdf has worked fine for what i need it for. the file i created had some quite complicated table structures and it rendered the pdf file fine. The only thing i would say is it is quite resource hungry.

    N.B Setting the page width to 800px in the html and creating an a3 page worked for fitting the content in the pdf window.
    You can not say you know how to do something, until you can teach it to someone else.

  • #5
    Senior Coder timgolding's Avatar
    Join Date
    Aug 2006
    Location
    Southampton
    Posts
    1,519
    Thanks
    114
    Thanked 110 Times in 109 Posts
    Change of mind. I got fed up with dompdf. It wasnt rendering html tables properly. So i tried TCPDF. Seemed much better and with more functions.
    It's alot bigger in size also.
    You can not say you know how to do something, until you can teach it to someone else.

  • #6
    Regular Coder
    Join Date
    Jul 2010
    Posts
    185
    Thanks
    3
    Thanked 42 Times in 42 Posts
    If if TCPDF doesn't suit the job and you haven't already found it, I can recommend Apache FOP.

    Very fine grained control over the document. It's a formatting object processor. You can build your doc as XML or (X)HTML and apply XSL stylesheets to produce a PDF. You can even replicate most CSS styles.

    I like it a lot but it does come at a price ... java. If you can live with the overhead, exec('fop') will do the trick.

    Also, it's released under the Apache license.
    Last edited by disastro; 08-13-2010 at 05:04 PM. Reason: Additional info.

  • #7
    Regular Coder
    Join Date
    May 2009
    Posts
    425
    Thanks
    3
    Thanked 62 Times in 61 Posts
    I recommended fpdf because it's relatively fast in generating PDFs. As for the layout, you just have to get a little clever but once you get the hang of it... piece of cake! I can guide you if needed.
    I'm the founder of Loggur, a place to build and share web apps focused on maximizing efficiency and productivity:
    http://www.loggur.com

    My personal site and blog:
    http://www.tfburgess.com


  •  

    Tags for this Thread

    Posting Permissions

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