I am trying to generate PDF from Visualforce but the problem I am running into is that content overlaps with Header.
Here is the image:
and here is the code:
<apex:page controller="QuotePDFCustomController" showHeader="false" renderas="pdf" standardStylesheets="false" applyHtmlTag="false" applyBodyTag="false">
<head>
<style type="text/css" media="print">
@page {
@top-center {
content: element(header);
}
@bottom-left {
content: element(footer);
}
}
div.header {
padding: 10px;
position: running(header);
}
div.footer {
display: block;
padding: 5px;
position: running(footer);
}
.pagenumber:before {
content: counter(page);
}
.pagecount:before {
content: counter(pages);
}
</style>
</head>
<div class="header">
<img src='{!URLFOR($Resource.fake_logo)}' title="logo" width="200px"/>
</div>
<div class="content">
<apex:panelGrid columns="2" id="theGrid" style="margin-top: 20px;">
<apex:panelGrid columns="2" id="CompanyAddressId">
<apex:outputText value="Company Address" id="theFirst"/>
<apex:panelGroup id="theGroup">
<apex:outputText value="{!$Organization.Street}" id="streetId"/>
<apex:outputText value="{!$Organization.City}" id="cityId"/>
<apex:outputText value="{!$Organization.State}" id="stateId"/>
<apex:outputText value="{!$Organization.PostalCode}" id="postalCodeId"/>
<apex:outputText value="{!$Organization.Country}" id="countryId"/>
</apex:panelGroup>
</apex:panelGrid>
</div>