You need to sign in to do that
Don't have an account?
Sankar Ganesh
How to remove last blank page in visualforce while renderas pdf
I am getting last page as a blank page while using renderas PDF. I used Style="page-break-inside:avoid;page-break-after:auto ; but still I am getting blank page. Kindly suggest me how to solve this .
I am facing this problem for below code
<head> <style type="text/css" media="print"> @page { margin-top: 5.0cm; margin-left: 1.0cm; margin-bottom: 30px; margin-right: 1.0cm; @top-center { content: element(header); } @bottom-left { content: element(footer); } } div.header { position: running(header); } div.footer{ page-break-after:avoid; page-break-inside:avoid; position: running(footer); } #table1{ border-collapse: collapse; } #table1 td{ border:1px solid black; padding:5px; } </style> </head>
I am facing this problem for below code
<div class="footer"> <table width="100%"> <tr> <td align="center">footer content here</td> </tr> </table> </div> <div> <apex:variable var="count" value="{!0}" /> <table id="table1" width="100%"> <tr id="hrow1"> <td align="center" width="27%" ><b>Item</b></td> <td align="center" width="40%"><b>Description</b></td> <td align="center" width="8%"><b>Qty</b></td> <td align="center" width="10%"><b>Cost</b></td> <td align="center" width="15%"><b>Total</b></td> </tr> <apex:repeat value="{!Quote.QuoteLineItems}" var="line" > <tr> <td><b><apex:outputText value="{!line.Product2.Name}"/></b></td> <td><apex:outputText value="{!line.Line_Item_Description__c}" escape="false"/></td> <td><apex:outputField value="{!line.Quantity}"/></td> <td > <apex:outputText value="{0, number, ###,###,###,##0.00}"> <apex:param value="{!line.UnitPrice}" /> </apex:outputText></td> <td> <b> <apex:outputText value="{0, number, ###,###,###,##0.00}"> <apex:param value="{!line.TotalPrice}" /> </apex:outputText> </b></td> </tr> <apex:variable var="count" value="{!count+1}"/> </apex:repeat> <tr style="page-break-inside:avoid;"> <td colspan="6" style="border-top:none;" > </td> </tr> </table> <table width="100%" style="border-collapse: collapse;page-break-inside:avoid;page-break-after:auto;"> <tr> <td colspan="2">{!Quote.Customer_Message__c}</td> <td colspan="2" align="right" ><b> Total:</b></td> <td align="right"><b><apex:outputField value="{!Quote.TotalPrice}"/></b></td> </tr> </table> </div>
I tried your style but that also not working. Here is my full code.