The possibility to output eMailings and lead pages as PDF has been part of Evalanche for a long time.
In the course of ongoing system optimizations in Evalanche, the technology used so far (PDF FO) is replaced by a modern and innovative generation technology (HTML2PDF).
Notice!
PDF Generation v2 is currently in open beta and can be tested immediately. In the course of ongoing system optimizations, the previously used technology (PDF FO) will be replaced by a modern and innovative technology.
The date for the changeover from PDF FO to the new technology is currently planned for 01.02.2022. From this date, the PDF FO-based templates of eMailings and lead pages will lose their functionality and PDFs will be generated exclusively with the new technology.
How it works
PDF generation in Evalanche renders valid HTML to PDF fully automatically. Due to this mode of operation, there is usually little or no optimization effort.
Based on the HTML version and optionally special CSS print styles (https://wiki.selfhtml.org/wiki/CSS/Tutorials/Print-CSS) of the individual media, PDF documents can be created automatically, and delivered personalized in real time.
For this purpose, the source code of the eMailings, lead page or website object is used and rendered as a PDF. The existing personalization variables for the PDF version of the media remain unchanged. By default, nothing needs to be done to get a working PDF of the media.
Migration from PDF FO
Existing objects and media can already be tested and optimized with the new PDF v2 display variant in the preview of e-mailing, lead page and website objects. Only at the time of migration, this form of PDF generation will completely replace the currently existing PDF FO technology.
Checklist to prepare for the migration
- Check whether you offer PDF representations of the content in the eMailing, LeadPage or Website objects, as well as their templates.
- Check the new PDF v2 representation in all relevant objects using the previously mentioned test option and note any discrepancies.
- Make necessary adjustments in the templates of the objects (except website) using Print CSS or TAL. The adjustments should have no effect on the inventory and should only take effect with the changeover and when previewing PDF v2.
- If you have any questions, we will be happy to assist you.
Optimization of the display
Via CSS media queries
The CSS media query "@media print" can be used to define any styles that deviate from the regular display.
For example, an image that is normally displayed with display: block;
can be hidden via display: none;
. Article structures can be protected from unsightly page breaks with page-break-inside: avoid;
or page-break-before:
always;
.
@media print {
.someclass { display:none;} .article { page-break-inside: avoid; page-break-before: always;}
}
Paper format and margins (also different for even and odd pages) can be defined individually. Example:
@page {size: A4 portrait}
@page :left {margin: 1cm 0.8cm 1cm 2.4cm}
You can find more information about Print-CSS Media Queries e.g. here: https://wiki.selfhtml.org/wiki/CSS/Tutorials/Print-CSS.
Notice:
Not all CSS commands are fully supported. For example, the display of the page number via CSS is not possible.
Via PHP-TAL
In addition, a TAL function (getIsPdfMode) is available which can be used to implement special PDF adjustments.
As an alternative to display adjustments via CSS, structural adjustments can also be made using tal conditions. For example, the condition "tal:condition="not:THIS/getIsPdfMode"" can be used to display an image in the standard view and hide it in the PDF display.
To note
Besides the Evalanche PDF representation, there is also the regular print function of the browser, which takes the CSS definitions into account (if supported by the browser), but not the valley conditions. A document modified purely via CSS would therefore appear the same/similar with both print variants in the best case, while the places modified via Tal would only be taken into account in the Evalanche PDF.