function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
jag-tcfjag-tcf 

I Created a footer using CSS which is a running footer for a visual force page render as pdf.

Best Answer chosen by Admin (Salesforce Developers) 
sekharasekhara

Hey Jag,

 

Can u please mark it as Solution so that it may help to others.

All Answers

sekharasekhara

Try this,,

<style type="text/css">

 @page{

margin-top: 20%;  
margin-bottom:9%;
margin-right: 7%;
margin-left: 5%;
size: A4;

@top-center {

content: element(header);

}

@bottom-center {

content: element(footer);

}

}
o
{
font-size:100%;
} <!-- Font Size -->
p.small 
{
line-height:67%;
}<!-- Line gapping -->
body {
font-family: Calibri;
}
div.header {
margin-left:8px;
margin-top: 18px;
margin-right: 5px;
margin-bottom:0px;
position: running(header);

}
div.footer{
margin-left:8px;
margin-top: 0px;
margin-right: 5px;
margin-bottom: 2px;
position: running(footer);
padding:0.5px;
}
div.margin
{
border-left-style:solid;
border-right-style:solid;
border-width:1px;
}

</style>

 
Let me know incase of any issues.

 

jag-tcfjag-tcf

Hi Raj,

 

I tried your code but im getting footer on top-left and also only on first page. I want footer on first three pages on left bottom. Anyway many thanks for your concern and help.

 

regards.

 

jag.

sekharasekhara

Hi Jag,

 

I am used same code more that 200 Pdf.

 

jag-tcfjag-tcf

Hi Raj,

 

My problem was solved many thanks.

 

Jag.

sekharasekhara

Hey Jag,

 

Can u please mark it as Solution so that it may help to others.

This was selected as the best answer
Pravi_1133Pravi_1133
Hi Jag,
I am facing the same problem, like footer is displaying only in first place. How did you fixed your's. thanks in advance.