• Naresh Vanamala
  • NEWBIE
  • 0 Points
  • Member since 2014

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 0
    Replies
Hi,

I am Generating PDF with repeated header and footer.

<apex:page standardController="contact" ShowHeader="false" extensions="InvestorAttachmentCtrl"  standardStylesheets="false"  renderAs="pdf" applyHtmlTag="false">
    <head>
    <style>
        @page {

        @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" >  
        <table width="700" cellspacing="0" cellpadding="5" border="0"  height="85">
            <tbody>
                <tr>
                  <td rowspan="2"><span style="padding-left: 5px"><apex:image url="{!$Resource.Logo}" width="100" height="50" style="margin: 0px 10px 0px 0px; width: 171px; height: 55px; border-color: #000000;"/></span></td>
                  <td><img src="images/line.gif" width="2" height="50"/></td>
                   <td style="padding-left: 15px" rowspan="2"><span style="font-family:'StoneSansStd-Semibold';  font-size:40px; color:#6D6E71"><b> LIST</b> 
                    
                     </span></td>
                </tr>
           </tbody>
        </table>                               
        <hr/>
    </div>
    <hr style="border-bottom: dotted 1px #000" />
    <span style="font-family:'StoneSansStd-Semibold'; color:#6D6E71"><b>ADVISOR: {!contact.Name} </b></span><br/>
    <span style="font-family:'StoneSansStd-Semibold'; color:#6D6E71"> SALES AGENT {!coninvList[0].internal_sales_agent__r.firstName} {!coninvList[0].internal_sales_agent__r.LastName} </span><br/><br/>
    <table border="0" align="justify">
        <hr/>
            <tr>
                <th style="font-family:'StoneSansStd-Semibold'; color:#6D6E71"> LAST NAME</th>
                <th style="font-family:'StoneSansStd-Semibold';text-align: center; color:#6D6E71"> STATE </th>
                <th style="padding-left:81px !important;font-family:'StoneSansStd-Semibold'; color:#6D6E71">AMOUNT INVESTED</th>
            </tr>
            <hr/>
            <apex:repeat var="coninv" value="{!coninvList}">
                <tr>
                    <td style="font-family:'StoneSansStd-Semibold'; color:#6D6E71">{!coninv.Last_Name__c}</td>
                    <td style="font-family:'StoneSansStd-Semibold';text-align: center;color:#6D6E71">{!coninv.State__c}</td>    
                    <td style="padding-left:81px !important;font-family:'StoneSansStd-Semibold';color:#6D6E71">$ &nbsp;&nbsp;{!coninv.Amount__c}</td>
                </tr>
                     </apex:repeat> 
                  </table>
<div class="footer"> 
        <hr/>
        <table>
            <tr>
               <td style="padding-left: 5px"><apex:image url="{!$Resource.Logo}" width="39" height="35" style="margin: 0px "/></td>
               <td style="padding-left: 15px ;font-family:'StoneSansStd-Semibold'; color:#6D6E71; font-size:9px;"><strong><b>xxxxxxxxxxxxxxxxxxx </b> |
                <br/></strong> xxxxxxxxxxxxxxxx  |  xxxxxxxxxxxxxxxxxx |
               
                 </td>
            
            
           
            </tr>
        </table>
    </div>
</apex:page>