Demos

Online DEMO: Conversion plugin

Convert your Word documents into PDF, RTF, HTML, ODF or legacy .doc documents

In certain cases you may want to deliver the documents generated via phpdocx in another format to guarantee their readablity by certain users.

Although the standard Basic version of phpdocx allow for the generation of simple PDFs its capabilities are quite restricted. The Advanced and Premium versions of the library circumvent that problem by using more powerful third party tools: Open Office for LINUX systems and Microsoft Office in Windows platforms.

This DEMO uses the LINUX version of Open Office that comes bundled with phpdocx as an external library.

Download code

01. Generate a fake product datasheet

You are going to generate a fake product datasheet out of the data recovered from this web form.

Please choose first an arbitrary ID number from the following dropdown list:

    This product datasheet is generated out from this Word template that you may dowload from here.

    This ID will be inserted in the header of the datasheet.

    This data could have been, of course, extracted form a database or other data source.

02. Choose the product image

Choose the image that will represent the product in the datasheet:

    A decent product datasheet should include at least one image of the product.

    We fake here that need including three images so you may check the functionality. In a more realistic example those images would be probably taken from a repository or database depending on the choosen product id.

03. Some standard variables to include in the template

    These are just a bunch of fields that will be icluded in the specification datasheet.

    We have limited some of these input boxes to eighteen characters for convenience and there is nothing intrinsic to that particular value.

04. Insert The Product Overview

    You may insert easily HTML chunks into your document using phpdocx.

    This example illustrate how to insert HTML content provided by a standard WYSIWYG text editor.

    The embedding oh HTML is not limited to the simple use given in this example.

05. Choose the output format

    We have chosen PDF to be the default value for this example.

    You may also choose (.doc) as output but be aware that since Word 2003 (with compatibility pack) all Microsoft Office suits open .docx documents.

    The other formats: HTML and ODF are also included as alternative options.