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
Uves RavatUves Ravat 

Page break on visual force page

Hi, i am creating page breaks between serveral invoices. This is currently working but the problem is that it always create a blank page at the can i avoid this.


here is the code i have using. for example if i have 4 invoice page it creates 5 pages


<apex:repeat value="{!invoicePageList}" var="invoicePage">
<c:SalesInvoicePage4 salesInvoicePage="{!invoicePage}" />
<div style="page-break-before: always;">&nbsp;</div>


Wrap the component within a div, and use the "page-break-after: always" css instead of "page-break-before: always" like you're using now. The current CSS causes the last page to have a single whitespace character, thus triggering the new page. Assuming there is no markup past the repeat tag, you won't have a blank page; if you do, then that markup will automatically appear on the start of the next page.

Uves RavatUves Ravat

am not sure if i did it correctly but i did as followers 


on the component page just after i declared the component i created the div

<div class="name of css field">


the css field will be on the visualforce place where i declare the component


that didnt page break after each invoice