Component Code :
<apex:attribute required="true" type="string" name="type" description="specify header and footer type" />
<apex:stylesheet value="{!$Resource.dynamicStylePdf1}"/>
<div class="{!type}">
<apex:componentBody/>
</div>
Style-sheet Code :
@page {
@bottom-left{
content: element(footer);
}
@top-center
content: element(header);
}
}
div.header {
position: running(header);
}
div.footer {
display: block;
position: running(footer);
}
.pagenumber:before {
content: counter(page);
}
.pagecount:before {
content: counter(pages);
}
@page :first {
@bottom-right {
}
@top-center {
}
@top-left {
}
@bottom-left {
}
}
Apex Code : Image
Answer
posts below thisQuestion
post unless you actually mean to answer your own question. If you have clarifications to add, edit this post.