建立PDF相關設定
*Repeat Header
*Repeat Footer
*Page Counter
*WaterMark
*Repeat Grid Header & Footer
*Force to Break Page
*To avoid the 2nd page shift up
<apex:page showHeader="false" sidebar="false" renderAs="PDF" standardStylesheets="false" applyBodyTag="false"
standardController="Quote" extensions="ext_CustomQuotationPDF">
<head>
<style type="text/css" media="print">
@page {
@top-center {
content: element(header);
}
@bottom-left {
content: element(footer);
}
size: 210mm 297mm;
margin: 15mm;
margin-right:0mm;
margin-top: 4.215cm;
margin-bottom: 2.80cm;
margin-left: 1.27cm;
margin-right:1cm;
}
div.header {
padding: 10px;
position: running(header);
height: 50px;
margin-bottom: 5px;
}
div.footer {
display: block;
padding: 5px;
position: running(footer);
clear: both;
margin-top: 15px;
}
.pagenumber:before {
content: counter(page);
}
.pagecount:before {
content: counter(pages);
}
.labelcls
{
margin-left:400px; font-size:25px; font-weight:bold;
}
table {-fs-table-paginate: paginate;}
</style>
</head>
<body>
<div class="header" width="100%">
Header Contents
</div>
<div class="footer" style="font-size:16px;">
Footer Contents
<center>
Page <span class="pagenumber"/> of <span class="pagecount"/>
</center>
</div>
<img src="{!URLFOR($Resource.WaterMark)}" width="100%" height="100%"
style="position: fixed;background-repeat:repeat;left: 0cm; top:0cm; z-index:-1"/>
<apex:variable var="PageNum" value="{!1}"/>
<apex:outputPanel layout="block" style="height:30px;" rendered="{!PageNum > 1}"/>
<table>
<thead>
<tr>
<th>ITEM</th>
<th>DESCRIPTION</th>
<th>QTY</th>
<th>STANDARD UNIT PRICE</th>
<th>EXTENDED PRICE</th>
</tr>
</thead>
<tfoot>
<tr>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
</tfoot>
<tbody>
<apex:repeat value="{!CustQuoteItem}" var="line">
<tr>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
</tr>
<apex:variable var="PageNum" value="{!PageNum+1}"/>
</apex:repeat>
</tbody>
</table>
<div style="page-break-before: always"> </div>
沒有留言:
張貼留言