Generate PDF, DOCX and DOC with PHP

Discussion in 'PHP' started by leo.bonnafe, Feb 4, 2009.

  1. #1
    Hello there

    I have just come across a new project that allows you to generate PDF, DOCX and DOC files with PHP.

    All you have to do, is create a template in Open Office (or Word). In the template, you create the layout of the document and insert a number of text fields. These text fields are then populated with data from PHP and the document can be saved as a PDF file or in any other supported format. The concept is good old "mail-merge".

    http://www.phplivedocx.org/articles/brief-introduction-to-phplivedocx/

    From the web sites' blurb: "phpLiveDocx allows developers to generate documents by combining structured data from PHP with a template, created in a word processor. The resulting document can be saved as a PDF, DOCX, DOC or RTF file."

    I am currently adding phpLiveDocx to an online store I am working on. The customer wants his store to create an invoice and sent it by e-mail as a PDF attachment. The invoice should use the same template file that is used in the internal accounting software (which is a DOC file).

    phpLiveDocx works well and it is much easier to get good results than with FPDF, TCPDF or Zend_Pdf.

    Download here:

    http://www.phplivedocx.org/downloads/

    Have fun :)

    Leo
     
    leo.bonnafe, Feb 4, 2009 IP
  2. crivion

    crivion Notable Member

    Messages:
    1,669
    Likes Received:
    45
    Best Answers:
    0
    Trophy Points:
    210
    Digital Goods:
    3
    #2
    But we need zend framework for that, which is painfull!
    It would be marvelous if was stand alone
     
    crivion, Feb 5, 2009 IP
  3. leo.bonnafe

    leo.bonnafe Peon

    Messages:
    4
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Yes, it does require the Zend Framework, but if you look closely at the code, you will see that the dependencies on ZF and be easily removed and you still get about 90% of the functionality.

    Anyway, many business web apps are being build on ZF nowadays.

    Have you downloaded phpLiveDocx and tried it out yet?

    Leo
     
    leo.bonnafe, Feb 5, 2009 IP