+ Start a Discussion
priya123priya123 

Pdf footer message

Hi,

 

    I am displaying some content in the bottom -left of Pdf Page.Here, i want to display the content in two seperate lines in the bottom-left corner of every pdf  page. like

 

   Equity Marketing

   Updated on date 08/01/20011.

 

Now the below code is displaying  inthe same line.Equity Marketing Updated on date 08/01/20011.

 

<head>
<style type="text/css">
@page {
    margin : 70pt .5in .5in .5in;
    @top-center {
        content :element(header);
        font-size : 10 px;
        color : #808080;
        width : 50 px;
     }
     div.header {
    position : running(header) ;
             }  

     
    @bottom-right
         {
            content: "Page: " counter(page) " of " counter(pages);
           
            color : #808080;
         }
       
    @bottom-left {
        content :"Equity Marketing " + <br> + "Updated on date 08/01/20011."; 
                
        font-size : 10 px;
        color : #808080;
    }
   
}
</style>
</head>

 

Please help. 

Best Answer chosen by Admin (Salesforce Developers) 
Ankit AroraAnkit Arora

I think you have  plundered this CSS from my blog :P

 

http://forceguru.blogspot.com/2010/12/header-footer-in-pdf.html

 

Well joke apart, here is the code :

 

<apex:page renderAs="PDF">
<head>

<style>

@page {
    margin : 70pt .5in .5in .5in;
    @top-center {
        content : element(header);
     }

    @bottom-left {
        content : element(footer);
    }
    
}

div.header {
    position : running(header) ;
}

div.footer {
    position : running(footer) ;
}

</style>

</head>

<div class="header">
    <apex:image value="https://forceguru-developer-edition--c.ap1.content.force.com/servlet/servlet.ImageServer?id=01590000000El61&oid=00D900000000spb&lastMod=1308239514000" />
</div>

<div class="footer">
    Equity Marketing <br/> Updated on date 08/01/20011.
</div>

<apex:pageBlock >
    Test Page 1
    <div style="page-break-after:always"/>
    Test Page 2
    <div style="page-break-after:always"/>
    Test Page 3
</apex:pageBlock>

</apex:page>

 

Thanks

Ankit Arora

Blog | Facebook | Blog Page

All Answers

Ankit AroraAnkit Arora

I think you have  plundered this CSS from my blog :P

 

http://forceguru.blogspot.com/2010/12/header-footer-in-pdf.html

 

Well joke apart, here is the code :

 

<apex:page renderAs="PDF">
<head>

<style>

@page {
    margin : 70pt .5in .5in .5in;
    @top-center {
        content : element(header);
     }

    @bottom-left {
        content : element(footer);
    }
    
}

div.header {
    position : running(header) ;
}

div.footer {
    position : running(footer) ;
}

</style>

</head>

<div class="header">
    <apex:image value="https://forceguru-developer-edition--c.ap1.content.force.com/servlet/servlet.ImageServer?id=01590000000El61&oid=00D900000000spb&lastMod=1308239514000" />
</div>

<div class="footer">
    Equity Marketing <br/> Updated on date 08/01/20011.
</div>

<apex:pageBlock >
    Test Page 1
    <div style="page-break-after:always"/>
    Test Page 2
    <div style="page-break-after:always"/>
    Test Page 3
</apex:pageBlock>

</apex:page>

 

Thanks

Ankit Arora

Blog | Facebook | Blog Page

This was selected as the best answer
priya123priya123
Thanks for ur reply.But in addition to this, i just want to add watermarking to the image in the first page of the pdf.?
Ankit AroraAnkit Arora

You have posted another post for that :

 

http://boards.developerforce.com/t5/Visualforce-Development/Watermarking-in-PDF/m-p/328471

 

And am working on it, will let you know if there is any solution to it. So can you please mark this post as solution so others may get benefit from it.

 

Thanks

Ankit Arora

Blog | Facebook | Blog Page

DBManagerDBManager

This is brilliant, and amazingly useful.

 

Thank you!