I generating the pdf and i am getting header border in first page only. from the 2nd page i am not able to get border in the header. How can i get the border.. below is the code for vf page..
<apex:page renderas="PDF" showHeader="false" applyHtmlTag="false" applyBodyTag="false">
<html>
<head>
<style type="text/css">
@page {
size: letter portrait;
margin-top: 100px;
margin-bottom: 100px;
@top-left {
content: element(header_left);
}
@top-center {
content: element(header_center);
}
@top-right {
content: element(header_right);
}
@bottom-left {
content: element(footer_left);
}
@bottom-center {
content: element(footer_center);
}
@bottom-right {
content: element(footer_right);
}
}
.header_left {
text-align: left;
position: running(header_left);
}
.header_center{
text-align: center;
position: running(header_center);
}
.header_right {
text-align: right;
position: running(header_right);
}
.footer_left {
text-align: left;
position: running(footer_left);
}
.footer_center {
text-align: center;
position: running(footer_center);
}
.footer_right {
text-align: right;
position: running(footer_right);
}
.pageNumber:before {
content: counter(page);
}
.pageCount:before {
content: counter(pages);
}
.header{
border-bottom: 2px dotted #cccccc;
}
</style>
</head>
<div class="header">
<c:MyComponent type="header" position="left">
<!-- left image-->
</c:MyComponent>
<c:MyComponent type="header" position="center"><!-- title--></c:MyComponent>
<c:MyComponent type="header" position="right"><!-- right text--></c:MyComponent>
</div>
<div class="footer">
<c:MyComponent type="footer" position="right" showPageNumbers="true"></c:MyComponent>
</div>
<apex:form >
<!-- content of body-->
</apex:form>
</html>
</apex:page>
Here is the Component:
<!-- Component Attributes -->
<apex:attribute type="string" name="type"
description="Determines if the component renders as a header or footer" />
<apex:attribute type="string" name="position"
description="Determines if component should render the text on the left, center, or right" />
<apex:attribute type="boolean" name="showPageNumbers"
description="Determines if the header/footer information displays the page number information." />
<!-- Component Variables -->
<apex:variable var="styleClass" value="{!LOWER(type)}_{!LOWER(position)}"/>
<!-- Component Body -->
<apex:outputPanel id="panelHeaderFooter"
styleClass="{!styleClass}"
layout="block">
<apex:outputPanel layout="none" rendered="{!showPageNumbers}">
<div>Page <span class="pageNumber"/> of <span class="pageCount"/> </div>
</apex:outputPanel>
<apex:componentBody />
</apex:outputPanel>