How to make ActivePDF WebGrabber break up pages properly for long text in the body portion

75 views Asked by At

The ActivePDF WebGrabber is used to convert HTML content to a PDF that contains header, body and footer. Each portion is a complete HTML document, and is given to WebGrabber as the argument value in the API.

When the body portion is long, which usually is contained in a single <p>, <div>, or <td> element in the HTML document, the generated PDF file will be multiple pages, and sometimes the page break cuts the last line of body text horizontally at the bottom of page right beyond the footer, and puts the upper portion of the line of text on the page where it cuts, and the lower portion of the line of text on the next page, as the start line in the body portion.

In other words, this is a line cut issue, and the location of cutting can be anywhere in the long text since it is unpredictable, even it is a line of string or sentence, and cause the whole line beheaded.

It looks like the fixed footer has overlap with the last line of the beyond body portion.

ActivePDF web site gives solution to long line page break issue, as to use "page-break-inside:avoid" CSS style on the text holder element, but it does not work, or apply to the extra long text in the body portion.

I will appreciate for any help or suggestion.

P.S. I tried setting API arguments as page width, page height, fixPageSize, and fixed height of header and footer, and they made no difference. The PDF file is for report, so the body portion is relatively dynamic.

P.S. I divided the long text into many <div> whose style has "break-inside: avoid !important", and now the WebGrabber generates a page for every single <div>. This is the first reaction of WebGrabber to CSS style "page-break-inside" or "break-inside" setting, though a wrong one.

0

There are 0 answers