Custom HTML oder nicht Custom-HTML
Introduction
When creating a print format there is a checkbox if the print format is a "Custom HTML". If checked the Print Format Builder and it's drag'n'drop layout is not going to be used. Instead we have a empty html editor where we can style, layout and enter our content.
The comparison:
Print Format Builder | Custom HTML |
Automatic page break in positions table, but a manual page break at a specific position is not possible. | No automatic page break possible, but manual page break within the positions table is a must. |
The html is spread into multiple building blocks | The complete html is in one big document |
Additional fields can be added via drag'n'drop | Additional fields can not be added via drag'n'drop |
A switch between the two different variants is not quickly possible. This is an important and not changeable remark that customers must be aware of. This is because the interchangability requires recreating the document's print format from scratch.
Im Endeffekt stellt sich die Frage, ob wir eine Automatik oder eine Gangschaltung haben wollen.
Banned HTML-Nodes and Styles
There are many HTML and CSS Elements that should not be used in Print Scripts of any kind. The reason is that the engine ( WKHTML2PDF ) will not translate the print script correctly.
- No floating elements ( e.g. <div style="float: left"></div> ) or use of the flexbox style paradigma
- Positioning of elements that are side by side like in a table is being done with tables ( e.g. <table> </table> )
- If under any circumstances we are required to use positioning of side by side elements we can use the col-md tags from bootstrap ( please refer https://docs.erpnext.com/docs/v13/user/manual/en/customize-erpnext/print-format )