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
Vidya BaskarVidya Baskar 

How do i add a page break in a Visual forcepage

I have a VF page that is basically created to generate a PDF document .
How do i add page breaks in this. 
The code is generating PDF and how ever i need a page break (need some content to be displayed in a fresh page).
How to do this.
Please suggest.
Best Answer chosen by Vidya Baskar
Sahil ShitoleSahil Shitole
Hi Vidya,

You can use:
 
<div style="page-break-after:always;"/>

OR

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

All Answers

Gian Piere VallejosGian Piere Vallejos
I had the same problem some time ago. If you want new content displayed in new page, you can wrap the content in an element <section> and add to it the css property: page-break-before: always;
 
<style>
     .page-break{
             page-break-before: always;
      }
</style>
<section class="page-break">
   /* Content in the new page. */
</section>

 
Sahil ShitoleSahil Shitole
Hi Vidya,

You can use:
 
<div style="page-break-after:always;"/>

OR

<div style="page-break-before:always;"/>
 
Thanks
This was selected as the best answer
Joy BingJoy Bing
AOL Mail is the first choice of users across the globe. Because of the ease of use that this email service comes with, most users opt for them only. You can now access your AOL Mail Login and AOL Sign In from any of your devices easily.