Forum


Replies: 4   Views: 3562
Howto number page
Topic closed:
Please note this is an old forum thread. Information in this post may be out-to-date and/or erroneous.
Every phpdocx version includes new features and improvements. Previously unsupported features may have been added to newer releases, or past issues may have been corrected.
We encourage you to download the current phpdocx version and check the Documentation available.

Posted by web.aseqroo  · 13-06-2013 - 18:59

Hola, como puedo concatenar addPageNumber con un texto, que quede de la siguiente forma "Página 1", etc. Y dos addList no respeta el formato de parrafo que le pongo aun haciendolo de la siguiente forma:



$texto = array();

$texto[] = array('text' => utf8_encode('Item 1'));

$txt = $docx->addText($texto, array('sz'=>11, 'jc'=>'both', 'rawWordML' => true));

$textoML = $docx->createWordMLFragment($txt);



$itemsList = array($textoML)



$options = array(

    'val' => 1

);

$docx->addList($itemsList, $options);


Posted by jorgelj  · 17-06-2013 - 09:22

Hello,



Please check this phpdoc:



------------------------------------------------------------



* @param mixed $type (String): numerical, alphabetical.

     * @param array $options Style options to apply to the numbering

     *  Values:

     * 'b' (on, off)

     * 'color' (ffffff, ff0000...)

     * 'font' (Arial, Times New Roman...)

     * 'i' (on, off)

     * 'jc' (both, center, distribute, left, right)

     * 'pageBreakBefore' (on, off)

     * 'sz' (1, 2, 3...)

     * 'u' (dash, dotted, double, single, wave, words)

     * 'widowControl' (on, off)

     * 'wordWrap' (on, off)

     * 'lineSpacing' 120, 240 (standard), 480...,

     * 'indent_left' 100...,

     * 'indent_right' 100...

     * 'defaultValue' (int)

     * 'rawWordML' (boolean)

     *



public function addPageNumber($type = 'numerical', $options = array('defaultValue' => 1, 'rawWordML' => false))



------------------------------------------------------------



That are all options you can use with the current version of PHPDocX.



Regards.


Posted by web.aseqroo  · 24-06-2013 - 18:42

Lo que necesito es poder concatener la palabra "Página" y el numero de página, de tal forma que en el pie de página del documento quede asi: "Página 1";


Posted by jorgelj  · 04-07-2013 - 12:10

Hello,



You can create a WordmlFragment and add it as footer content and then add the page numbering. Or you can use a custom template with that footer.



Regards.