News

PHPDocX - the basics

  • May 03, 2011

If you are new to PHPDocX, there are some things that never change when you create a .php document that will generate a .docx document. There are the basics that you should never forget.
you always need to include:

The path to the library.
Create an instance of the CreateDocx object.
A call to the createDocx method to output a docx file

Something that may look like this:


// Call the library: you must start always with this line
require_once '../../classes/CreateDocx.inc';
// Create a docx document
$objDocx = new CreateDocx();
// below this point, you could add your programming

// When you finish your programming, simply create your docx document and give it a name that you could remember
$objDocx->createDocx('template_image.docx');