Posted: 21 Jan 2016 5:02 EST Last activity: 26 Jan 2016 4:42 EST
Creating a Border Less, Margin Less PDF.
We have a requirement where I need to generate address labels in the format 105*48. So one A4 Sheet will contain 12 address labels.
Problem is if I use OOTB HTML to PDF , passing a section as parameter. PDF gets generated with margin and borders and labels don't fit on paper. Instead of a section, if I pass a HTML stream (hancoded html with CSS to render a border less and margin less html page) my styles are not getting rendered in PDF.
Have any one tried this before? Do we need to write whole java code from scratch to generate PDF. If Yes, what are pdf libraries we have in Pega that can help me achieve this?
The HTMLTOPDF activity will take your CSS into account (if it is not, then we need to look at your example in more detail).
If your requirement is to create a PDF for (say) a letter or (say) a report: you can create your own HTML Rule (which can include Pega Tags - so you can use it like a JSP/Template to populate Property Values in it).
You can use HTMLTOPDF to convert your HTM (which can contain embedded or linked CSS : start with embedded for ease of testing maybe) without having to resort to manual Java Steps.
Update -- I tried PDF/A generation mode and used \u2212 (Minus equivalent), works for me for display. I guess \u2011 was not rendering even in PDF/A mode because the system font was not supporting this. I will have to run few more test to confirm this anyway.