BNHtmlPdfKit icon indicating copy to clipboard operation
BNHtmlPdfKit copied to clipboard

Any ideas for page breaks?

Open BoomerBrian opened this issue 10 years ago • 6 comments

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?

BoomerBrian avatar Jul 25 '14 02:07 BoomerBrian

Did you find a solution for this? I can't seem to find a good solution either.

jarrodglasgow avatar Aug 25 '14 18:08 jarrodglasgow

< br / > works for me as a page break

Alifar avatar Mar 08 '15 21:03 Alifar

I have add this code to html file

<div style="page-break-before:always;"></div>

It work well.

wisaruthk avatar Sep 01 '15 10:09 wisaruthk

I tried following but it adds one more blank page before that content. Any other solution ?

<div style="page-break-before:always;"></div>

simform-solutions avatar May 30 '16 12:05 simform-solutions

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.

wisaruthk avatar May 31 '16 01:05 wisaruthk

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>"];

simform-solutions avatar Jun 01 '16 06:06 simform-solutions