Forum


Replies: 3   Views: 3403
How added page-of option to insert numberings of the “page x of y” in format x/y.
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 DenisIdo  · 13-10-2016 - 13:47

The new version has the ability to add page numbers.
I use the example code

$docx = new CreateDocx();

$style = array(
    'bold' => true,
    'color' => 'B70000',
    'sz' => 30,
);

// create a custom style
$docx->createParagraphStyle('pgStyle', $style);

// create a Word fragment to insert in the footer
$numbering = new WordFragment($docx, 'defaultFooter');
//sert some formatting options
$options = array(
    'textAlign' => 'right',
    'pStyle' => 'pgStyle',
);
$numbering->addPageNumber('page-of', $options);

$docx->addFooter(array('default' => $numbering));

When using this feature, I kind of numbering is shown Page X of Y.

How can I change the output format to the X / Y?

How can I translate the text "Page of" another language?