Not being able to set distance from edge of page to html element
Not being able to set distance from edge of a page to a html element, that is header, footer, or side borders.
Steps to Reproduce
1. Create a HTML Section.
2. Pass the created html section to HTMLTOPDF activity.
3. Observe the generated document.
Here’s the explanation for the reported behavior:
Pega provides Activities for generating PDFs from HTML streams. The Activities HTMLToPDF and Code-Pega-PDF.View are used to generate convert any HTML stream to PDF (HTMLToPDF) and send the PDF back to the browser (Code-Pega-PDF.View)
Some of the limitations include:
1. Organizations often have headers and footers which must be included on PDF documents rendered. These however, are not included on the UI generated for the application.
2. The data displayed on the PDF may have additional formatting requirements like:
a. Spacing or font requirements
b. Colour schema
3. The data displayed on the PDF may have additional or different visibility restrictions.
To overcome these in a Pega application, there are two options available:
1. Use an open source library like iText for PDF generation. This will allow the system architect to have more granular control over the PDF formatting.
2. Leverage the PD4ML API for configuring the formatting requirements.
Leveraging the PD4ML API is the preferred option with Pega as it provides a higher level of abstraction which is easier to work with.
Additionally, this is a licensed product bundled with the base Pega product and therefore has better support available.