You need to sign in to do that
Don't have an account?

Page Break when visual force PDF is rendered dynamically content
Hi There,
I am generating a pdf .
the content on the pdf is dynamic from different objects and different products.
i want to fit the content of one page , but in my pdf content is going to other page .
if the product information is not fit into one page i want to move to other page , which should happen when page rendered .
Thanks
got the solution
<div style="page-break-after:always;"> put here your content </div>
All Answers
See if this helps
http://mindfiresfdcprofessionals.wordpress.com/2013/08/10/page-break-functionality-for-printing-record-detail-page/
If this post is helpful please throw Kudos.If this post solves your problem kindly mark it as solution.
Thanks
Hi There ,
If you put your Data content in Div and set style of div as "page-break-after:always;" the contents will be automatically reflect on next page .
But if you want everything on the same page then you have to style @page in your css . You can give height and width of your page using size property .
For example :
You can set size of First page
@page:first {
margin-top: 0.5cm;
margin-bottom: 0.5cm;
margin-left: 0.5cm;
margin-right: 0.5cm;
size: 220mm 300mm;
/* page-break-after:always; */
/* page-break-after:auto; */
/*border :1px solid black;*/
/*border-bottom :1px solid black;*/
}
(For second page )
@page{
margin-top: 0.5cm;
margin-bottom: 0.5cm;
margin-left: 0.5cm;
margin-right:0.5cm;
size: 220mm 300mm;
/* border :1px solid black; */
}
Thanks ,
Ajay
Hi Ajay,
Actually what i want is each location details i want to in different page , when ever the locaions starts it should stars in diffetent page not on the same page.
if frst location is not having any data leave the empty plave and put the 2 nd location in different page .
can we do this kind of page break in PDF.
as you please suggest it is possible to do that or not ?
got the solution
<div style="page-break-after:always;"> put here your content </div>
Great !! That is what I pointed you in the above link.
Anyways good that you find it.
Hi, i got one more problem , i am able to break the page and display page numbers but the problem is that the pdf is displaying after 2 pages content 3 or last page is empty. I don't want to display that last page as epty page with page number.
can you please suggest how can remove last page as empty page.
thank you,
As I saw above, we have @page:first page rule but we don't have @page:last in this.
Actually i have put footers in the PDF that i am generating and i don't want to show the footer at the last page of the pdf.
Is there anythink that can solve this problem?
Thanks in Advance
body { box-sizing: border-box; height: 11in; margin: 0 auto; overflow: hidden; padding: 0.5in; width: 8.5in; }
here i am using width and height with auto value.