Question

1
Replies
54
Views
X

Page Breaks in PDF not being applied since Pega 8 Upgrade

We have until recently used Pega 7.2.2, and our application has relied on browser built in PDF generation functionality to comply with business needs, because the HTMLToPDF activity was not satisfactory.

To ensure the generated PDF applied page breaks on predetermined places, we created a section which contained a Dynamic Layout with two content CSS classes.

Within our application skin we added an additional style sheet containing the following css:

@media print{

  .ClassName1{
    page-break-before: always;
    margin: 0;
    padding: 0;
  }
  .ClassName2 {
    page-break-before: always;
  }
}

Since upgrading to Pega 8 (8.3.1), page breaks have stopped being applied entirely. Our reference 7.2.2 client still applies page breaks as intended.

We have attempted the following solutions:

  • Specifying page-break-before:always, page-break-after:always, position:relative, and combinations of these, in the additional style sheet
  • Adding a container to the section for page breaks. Within that container specifying "page-break-before: always; page-break-after:always" under additional styles.
  • Converting the section for page breaks to non-automated HTML with the code:
<div class="ClassName1 ClassName2"></div>

and

<div style="page-break-before:always"></div>
  • Removing "@media print{}" from the additional style sheet.

Unfortunately, none of these changes have made any page-breaks appear in the generated PDF.

Any and all suggestions on how to solve this are appreciated. Thank you in advance.

***Edited by Moderator: Pallavi to update platform capability tags***  

Pega Platform 8.3 Application Development Dev/Designer Studio User Interface Financial Services Senior System Architect