BNHtmlPdfKit
BNHtmlPdfKit copied to clipboard
Any ideas for page breaks?
Trying to figure out the best way to add page breaks. I tried adding css page breaks but that doesn't seem to work well. I also tried inserting empty tables with a given height to push content to the next page but that doesn't seem to work well either. Any ideas for solving this problem when converting using your library?
Did you find a solution for this? I can't seem to find a good solution either.
< br / > works for me as a page break
I have add this code to html file
<div style="page-break-before:always;"></div>
It work well.
I tried following but it adds one more blank page before that content. Any other solution ?
<div style="page-break-before:always;"></div>
for more example, let add to the other element
<table id="a">...</table>
<table id="b" style="page-break-before:always;">
<thead>
<tr>
<th scope="col" colspan='6'><h2>[title]</h2></th>
</tr>
</thead>
<tbody>
</tbody>
</table>
This code use on my work, The table "b" will start at the new page.
I tried this code too but having same result. When I append following code to my body it creates additional blank page and after that its will show the [title]
My objective C code is [body appendString:@"<table id=\"b\" style=\"page-break-before:always\"><thead><tr><th scope=\"col\" colspan='6'><h2>[title]</h2></th></tr></thead><tbody></tbody></table>"];