Hi all,
I'm pretty stuck on this one. What I'm trying to accomplish is to page break after a certain block element, so that the print output confines one table / block element per page.. For example, I'd like to use LFForms calls to retrieve table values, and then inject HTML into an HTML Field using the table data. The Data should be separated by Page Breaks. This is using LF Cloud.
// -- This Section is Going to try and implement page breaks var contentPB = '<table class="tablePB"><tr><td> This text will go over the page and force a break because it ACTS large and in charge</td><td> We be demonstrating multiple elements</td></tr></table>' for (i=0; i < 6; i++) { let tempPB = '<table class="tablePB"><tr><td> This text will go over the page and force a break because it ACTS large and in charge</td><td> We be demonstrating multiple elements</td></tr></table>' contentPB += tempPB } LFForm.changeFieldSettings( {fieldId: 5}, {content: contentPB} )
yields:
I've gotten so many mixed results I'm not really sure what is going on. I'm only trying to use one HMTL field because I don't believe the LFForm Object allows you to add fields. I've had it break the page 3 times per table/block element (and stop after that...?) and tried:
- flipping between <div>, <p> and <table> tags
- <div style="page-break-after: always">
- .pagebreak { break-after: page } => <div class="pagebreak">
And so on.
Not sure what I'm doing wrong. Thanks!
EDIT: A Different Approach...
Rather than using a HTML Inject table, it seems like a Collection has produced the results I've wanted.
I could then apply the CSS class to distribute the sets:
.fl-collection.fl-component {height:auto;} // this helps with odd CSS calculations // Helps me fit as many full badges per page .fl-collection.fl-component .collection-set { page-break-inside: avoid; }
-or-
// Forces one per page .fl-collection.fl-component .collection-set { page-break-before: always!important; }
I was able to utilize Javascript to inject HTML using LFForm.getFieldValue() from the arrays of the collection, but I didn't use this in the case where I needed the page breaks.
I'm still having issue using page breaks happening after the HTML Object (or anything after).