News

Create a PDF with PHPdocx

  • May 03, 2011

Warning

This post is outdated. For up date information about creating PDF documents please refer to the Conversion plugin tutorial documentation.

PHPdocx can create PDF when the .docx document is also produced. You must call the document at same path and generate the PDF. This code shows you how to do it.
The library generates a PDF out of a built .docx document but a "little format" may be lost in the process (it uses XSLT transformations that are pretty complicated and sometimes difficult to implement). We are improving on those methods.


require_once '../../classes/TransformDoc.inc';
$document = new TransformDoc();
$document->setStrFile('../files/Text.docx');
$document->generatePDF();