Skip to main content

This content has been archived and is no longer being updated. Links may not function; however, this content may be relevant to outdated versions of the product.

Support Article

Unable to set Page breakup and Page numbering in PDF doc



The requirement is to set Page breakup and Page numbering in a PDF document.

Error Messages

Not Applicable

Steps to Reproduce

  1. Configure a section.
  2. Pass the section name to the 'Create PDF' Utility Shape.

Root Cause

A software use or operation error.


Perform the following local-change to add Page of Total page (Page numbers) in the generated PDF.

The HTMLToPDF contains the pyPDFFooterHTMLTemplate parameter for the Footer template which is used to add Page numbers to each of the generated PDF page.
  1. Create an HTML fragment and Include the below variables in the JSP.

    $[page] – This variables contains the Page Index

    $[total] – This contains the total number of pages to be generated in the PDF.

    Paste the code as below in the JSP.

    <div style='text-align:center;'>Page $[page] of $[total]</div>

  2. Add a step in the pyAttachAsPDF after Step 5.
  3. Set the above HTML fragment to Param.pyPDFFooterHTMLTemplate using the Property-Set-HTML method in the pyAttachAsPDF in the step created.

    Output displays as below,

Suggest Edit

Published January 10, 2020 - Updated December 2, 2021

Did you find this content helpful? Yes No

Have a question? Get answers now.

Visit the Collaboration Center to ask questions, engage in discussions, share ideas, and help others.

We'd prefer it if you saw us at our best.

Pega Community has detected you are using a browser which may prevent you from experiencing the site as intended. To improve your experience, please update your browser.

Close Deprecation Notice
Contact us