I am trying to insert page-break-after:always; into the Print.css of a dynamic invoice.
The project is using Bootstrap 3, and I have been testing the printing on Chrome. In the invoice HTML I am using the bootstrap grid system, with bootstrap's 'hidden-print/visible-print'.
The issue I am having is: while using Bootstrap, Chrome is not recognising the page-break-after:always. I have read this is due to 'float:left' and many other factors, but after hours/days of tweaking them, it seems to make no difference. Print-break-inside:avoid; works fine.
I am curious if anyone else has encountered this recently, or if anyone with a superior knowledge of Bootstrap's inner-workings knows the root of this issue definitively?
It seems this is a ongoing problem, that Bootstrap knows about, and that may be fixed in Bootstrap 4. Until then I am stuck. I have no idea now how to achieve a print-break-after with dynamic content while using Bootstrap. Removing Bootstrap is not really an option due to the way the CSS is being loaded in my project.
Thanks in advance.
EDIT: Fixed
The only fix I found was to rebuild the layout by hand after setting:
float: none !important;
position: static !important;
in @media print.
This makes the Bootstrap col-* not work, but now the page breaks do. Pretty brutal fix but at least it worked. The 'row' class of bootstrap still works though, so there's that. Thanks for the help folks.