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
hoffmann1.39658926698286E12hoffmann1.39658926698286E12 

Configuration Visualforce PDF - Header and Footer for each page with one apex code

I have one apex code <apex:outputfield value="{!pba__Listing__c.Object_description__c}"></apex:outputfield>. The content of this code will always have a diffrent length and goes over 1-3 pages. So its defined as one big body. I want to define the header and footer for each page.
But I cannot figure out how to define this apex code that it finishes at the bottom of each page.  
All submissions I give in for header and footer are just shown up at the first page and on the last page. But not for the pages in the middle. I tried already several instructions to define it but the header and footer always float over the content in the apex code or the other way around. 

Any suggestions how I can solve my problem?

Matt WhalleyMatt Whalley
If you know where your page breaks are, you can always re-initiate the headers and footers again with the new value... or just do a apex:repeat with the header and footer define within.
hoffmann1.39658926698286E12hoffmann1.39658926698286E12
Thank you very much for your answer. Well, I know where the page breaks are. My problem is that on the first page I have one apex tag, and the content of this tag floats over the footer and header from the next page. I would need a code so that I can define the margin to the footer, so that the content does not float over. I tried already to define the margines of the header and footer, but it is not working. Do you have any idea how I can define the footer and header for each page the same so that the content from this one tag is not floating over it?
This is my code:

<apex:page standardController="pba__Listing__c" extensions="pba.RecommendationEmailSingleListing" renderAs="pdf" showHeader="true">

<html>
<head>

<style type="text/css">

</style>
</head>
<body style="margin-bottom: 30px; font-family: Arial Unicode MS;"></body>

<div id="header_container">
<div id="header">
<div style="position:absolute; top: 1em; left:74%; high:50 px; margin:5px; width:100%; height:50px; margin-bottom:5px;"><img src=" https://c.eu2.content.force.com/servlet/servlet.Image.. "></img></div>
</div></div>

<div id="content">
<div style="background-color:white; margin-top:70px; high:100%; width:100%;">

<p class="pDate" style="text-align: right; font-size: 16px;"><span style="font-size: small;"><span style="font-size: medium;"><span style="font-family: arial, helvetica, sans-serif;">{! pba__Listing__c.Date__c }</span></span></span></p>
<br></br>
<p style="text-align: left;"><span style="font-size: xx-large;"><strong><span style="font-family: arial, helvetica, sans-serif;">{! pba__Listing__c.Name }</span></strong></span></p>
<br></br><br></br>
<table style="margin-bottom: 10px;">
<tr>
<td> <p style="text-align: left;"><span style="font-size: 24px;color:#005088;"><strong><span style="font-family: arial, helvetica, sans-serif;">{!pba__Listing__c.Subtitel__c}</span></strong></span></p>
</td>
<td style="margin-right: 100px; ">
<div class="divMainImg">
<apex:image url="{!mainImage.pba__URL__c}" styleClass="imgMainImg" style="width: 450px; float:right"/> 
</div>
<div style="margin-right: 15px;"> </div> 
</td>
</tr>
</table> 
<br></br>

<div class="divObject_description"><span style="font-family: arial, helvetica, sans-serif ; padding-top:10px; margin-top: 90px; margin-bottom:30px;"><br /> <apex:outputfield value="{!pba__Listing__c.Object_description__c}"></apex:outputfield></span></div>
<div class="divImagesWrapper" >
<apex:variable var="cnt" value="{!1}" />
<apex:repeat value="{!images}" var="image">
<div class="divSmallImg" style="display:{!IF(cnt > 9,'none','inline-block')}; Padding-top:10px; margin-right: 10px; margin-left: 30px; margin-top:20px; margin-bottom: 20px;">
<apex:image styleClass="imgSmallImg" url="{!image.pba__MidresURL__c}" style="width: 300px;"/>
</div>
<apex:variable var="cnt" value="{!cnt + 1}" />
</apex:repeat>
</div>

<br></br><br></br>
<br></br><br></br>
<div id="footer_container">
<div id="footer">
<br><span style="position:fixed; left:8%; bottom:0px; font-family: arial, helvetica, sans-serif; font-size: 12px; color: #808080;">Red Square Properties • Ul. Bolshaya Dmitrovka 23/1, 6<sup>th</sup> floor • 125009 Moscow, Russia •  www.red-square.com </span></br>
<div>
</div>

</div></div></div></div></html></apex:page>