function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
RepsGRepsG 

New Page Break for PDF

I would like my table to start on Page two on my visualforce page which is rendered as a PDF.

 

What is the code for Page Break?

Best Answer chosen by Admin (Salesforce Developers) 
RepsGRepsG

I found the solution.

 

Use

<div style="page-break-before:always;"> {YOUR CONTENT} </div> 

 

All Answers

RepsGRepsG

I found the solution.

 

Use

<div style="page-break-before:always;"> {YOUR CONTENT} </div> 

 

This was selected as the best answer
bob_buzzardbob_buzzard

From Quinton Wall's excellent article http://wiki.developerforce.com/page/Creating_Professional_PDF_Documents_with_CSS_and_Visualforce:

 

--- snip ---

 

The secret sauce in our ability to control page breaks within CSS is a little known CSS tag called page-break-after. This tag allows you to control when a page break occurs in a HTML document, or in our case, a PDF document. You can specific whether you want the break to occur before, or after a tag the style is associated with. For this tutorial we are going to want to break after, and so we'll need some CSS that looks like this:

1page-break-after:always

Now remember when we were deep in Apex code building our collection of arrays of quote line items? It is time we started putting that hard work to the test, and combine it with our page-break-after style. Start by looping over the collection or arrays:

1<apex:repeat value="{!pageBrokenQuoteLines}" var="aPageOfQuotes"id="theList">

Next we are going to add a div with the following style:

1<div style="page-break-after:always;">

 

 

--- snip ---

 

 

RepsGRepsG

Thanks Bob