Skip to main content


 

Symptoms

 


When printing a form to PDF via the Print To PDF control, SmartForm controls often cut themselves off awkwardly. Is there any way we can add page breaks to this form so that it prints to PDF in a predictable way?
 

 

Diagnoses

 


At the moment, this is not possible via out-of-the-box controls.
 

 

Resolution

Workaround to add your own page breaks:

 

 

 

The SaveAsPdf control injects <BR> at the end of each tab and <DIV style="page-break-after:always"></DIV> at the start of each tab content to allow the tabs on a form to start rendering on different pages.

The documentation mentions support for alternatives (we have not verified that these are working correctly)
Automatic and custom page breaks
ExpertPdf automatically inserts page breaks when needed, paying attention not to break lines of text or images. Custom page breaks can be added using simple page-break-before and page-break-after css styles.
http://www.html-to-pdf.net/html-to-pdf-converter.aspx

Below is an example of using the page-break-inside:avoid style. The table contains a large number of rows, each row containing an image in the left and a text in the right and we don’t want a row to span on two pages.
<table>
<tr style="page-break-inside : avoid">
<td>
<img width="100" height="100" src="img1.jpg">
</td>
<td>
My text 1
</td>
</tr>

<tr style="page-break-inside : avoid">
<td>
<img width="100" height="100" src="img2.jpg">
</td>
<td>
My text 2
</td>
</tr>
</table>

http://www.expertpdf.net/expertpdf-html-to-pdf-converter-page-breaks/

 

 

 

 



 

I mate, your post is a bit confusing.

 

What are those links? What is ExpertPdf? Where does one place the HTML you posted?

 

I found your post because I need to insert a page break before a view on a form, I'm using PDF Converter to them convert that to PDF. Is your post worth reading given my task?

 

 


Reply