SmartForms: Forced page break occurs when using the save to PDF function

  • 16 February 2021
  • 0 replies
  • 229 views

Badge +3

Issue

A user may face an issue where it seems a forced page break is enabled when saving to PDF if all the views are not able to fit on a page. For example, if two views are added to a form but both views would not fit on one page, the product will split the views into two pages, and this will split the elements as well.

 

 

Error Code

Not applicable.

 

Resolution

In K2 Five (5.4) the PDF Converter now makes use of a new engine. With these changes and enhancements that were made, when it comes to page breaks, Chromium decides where it is best to make the page break. What this means is that the workaround used in the past to insert page breaks by injecting CSS no longer works.

 

The workaround is to add CSS directly into an expression which can then be applied to a data label control that should be added to the form. It must be a literal control and prevent XSS should be turned off. This is an example of the CSS:

 

<style>@media print{.form>.row{ display:grid}.Grid-Layout > .editor-cell .SFC{display:inline-block!important;page-break-after: always;page-break-inside: avoid;}}</style>

Additional Information

 

You may notice this issue from K2 Five  (5.4) and onwards.

 

Related Links


0 replies

Be the first to reply!

Reply