PHP Developers Generate PDF, DOCX, DOC and RTF With phpLiveDocx

Traditionally, the generation of professional looking PDF files with PHP has been a tricky programming task, even though a number of existing PHP libraries are available. Using those libraries, developers can convert HTML documents to PDF or programmatically generate PDFs from scratch.

Business documents created using HTML are limited by the capabilities of HTML, and it is extremely tedious, sometimes impossible, to get the layout of documents just right, using direct PDF generation.

With phpLiveDocx, both of these problems are addressed. Templates, created in a WYSIWYG environment, such as a standard word processor, are populated with structured data from PHP. The resulting document can be saved as a PDF, DOCX, DOC or RTF file, much like mail merge.

Three basic concepts:

  • Separate template and programming logic
  • Populate templates by assigning values
  • Uses standard SOAP web service
  • This simple and standard interface has major benefits to an enterprise. With separate template and programming logic, a graphic designer can produce the template, and a developer can populate it. Changes to the layout of a template can be made with no changes to the programming logic.

    Using phpLiveDocx, populating a template is simply a matter of assigning a value to a text field. When PDF templates are to be populated using existing solutions, the x and y coordinates of the position at which text should inserted must be specified. It is very time-consuming to calculate these coordinates and in some cases, not possible at all.

    phpLiveDocx is the PHP5 implementation of the SOAP web service LiveDocx. Existing standard software is used on the server, in order to use phpLiveDocx. The complex word processing and mail-merge processes take place on the backend platform. This lowers maintenance costs, and reduces hardware requirements of the client web server.

    phpLiveDocx has been written to fit the architecture of the Zend Framework and follows its extreme simplicity philosophy.

    Documentation and runnable sample phpLiveDocx applications are available. [ Brief introduction to phpLiveDocx ]

    Contact: Jonathan Maron

    Alan Gray is the Publisher and Editor-in-Chief of NewsBlaze Daily News and other online newspapers. He prefers to edit, rather than write, but sometimes an issue rears it’s head and makes him start hammering away on the keyboard.

    Content Expertise

    Alan has been on the internet since it first started. He loves to use his expertise in content and digital marketing to help businesses grow, through managed content services. After living in the United States for 15 years, he is now in South Australia. To learn more about how Alan can help you with content marketing and managed content services, contact him by email.

    Technical Expertise

    Alan is also a techie. His father was a British soldier in the 4th Indian Division in WWII, with Sikhs and Gurkhas. He was a sergeant in signals and after that, he was a printer who typeset magazines and books on his linotype machine. Those skills were passed on to Alan and his brothers, who all worked for Telecom Australia, on more advanced signals (communications). After studying electronics, communications, and computing at college, and building and repairing all kinds of electronics, Alan switched to programming and team building and management.

    He has a fascination with shooting video footage and video editing, so watch out if he points his Canon 7d in your direction.