Forum


Replies: 1   Views: 2987
Page numbering - skip first 2 pages
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 Brck  · 04-06-2018 - 13:19

Hi!

Is there any way to skip the first two pages when inserting page numbers, i.e so that effectively the third page has number 1, the fourth page has number 2 and so on?

According to the documentation it seems to be possible to have a special first page (for example excluding page numbering) but it does not say if it would be possible to do the same with the second page.

Thanks. 

Best,

Brc

Posted by admin  · 04-06-2018 - 15:37

Hello,

UPDATE: phpdocx 9 added the pageNumberType option to set start and format values when creating new sections using addSection.

You can work with sections (https://www.phpdocx.com/api-documentation/layout-and-general/add-section-Word-document-with-PHP)  or a custom template. Anyway, the easiest solution is generating the DOCX documents standalone (first and second pages as a document, and other DOCX with the page numbering) and then merge them using mergeDocx (https://www.phpdocx.com/api-documentation/docxutilities/merge-Word-documents-with-PHP).

Regards.