Register Lost your password?

public function fCreateDocx(string title = ‘document’, array arrParamsDocument = array())

Parameters

title

  • filename of the document



$arrParamsDocument

  • ‘orient’ (page orientation) :’landscape’
  • ‘top’ (top margin) : 4000,..
  • ‘bottom’ (bottom margin) : 4000,..
  • ‘right’ (right margin) : 4000,..
  • ‘left’ (left margin): 4000,..
  • ‘titlePage’ (if the first page contains the header): 1

Examples

Example 1


require_once('../classes/cCreateDocx.inc');
$objDocx = new cCreateDocx();
$arrParamsDocument = array('orient' => 'landscape','top' => 4000, 'bottom' => 4000, 'right' => 4000; 'left' => 4000, 'titlePage' => 1);
  $objDocx->fCreateDocx('ejemplo_Cabecera_y_pie.docx', $arrParamsDocument);

    4 Responses

  • Greg

    You need to do some major rewriting for php 5.3 as the word NAMESPACE is reserved. I would also recommend using a naming convention similar to how the Zend Framework is set up so that you do not need to declare your own autoloader.

  • Greg

    Also, lines 19, 21, and 22 of cCreateDocx.inc declare variables that are either not used or improperly named.

    private $intIdWords;
    - should be
    private $intIdWord;

    private $xml_ContentTypes__Content;
    - should be
    private $xml_ContentType__Content;

    You should set up a public forum for people like me to post these issues.

  • Ian

    I’m currently installing phpdocx files.
    I tried to run the file Documents_font.php in the examples folder. It simply returns error.

    Can’t find the echo that spits out this Error. To see where I have gone wrong.

    Can you point me in the right direction?

  • letux

    you have an error in you doc:

    $arrParamsDocument = array(’orient’ => ‘landscape’,'top’ => 4000, ‘bottom’ => 4000, ‘right’ => 4000; ‘left’ => 4000, ‘titlePage’ => 1);

    should be (=>4000;)

    $arrParamsDocument = array(’orient’ => ‘landscape’,'top’ => 4000, ‘bottom’ => 4000, ‘right’ => 4000, ‘left’ => 4000, ‘titlePage’ => 1);

Your comments