I've been looking everywhere and trying lots of things (going back to version 28 and older, using doctype="html-5.0" and more.), and I can't seem to get the landscape orientation to trigger when rendering as a PDF.
What am I doing wrong? (somewhat Redacted). Any help is appreciated!!
<apex:page standardController="Appeal_Review__c" extensions="EXTENSION1, EXTENSION2" showHeader="false" renderAs="pdf" applyBodyTag="false" applyHtmlTag="false">
<!-- <Apex:pageblock title="Export Results"> -->
<html>
<head>
<style>
@page {
size: landscape;
margin: 25mm;
@top-center {
content: "Sample";
}
@bottom-center {
content: "Page " counter(page) " of " counter(pages);
}
}
.page-break {
display:block;
page-break-after:always;
}
body {
font-family: Arial Unicode MS;-->
}
</style>
</head>
<body>
<div style ="page-break-before:always">
<table width = "100%">
<tr>
<td align="center" height="30" valigh="center"><b><i> Search Results </i></b></td></tr>
</table>
<table width="100%" height="10"><tr><td></td></tr></table>
<table width="100%" border="1" cellpadding="5">
<tr>
<th align="center" width="10%">column 1</th>
<th align="center" width="10%">2</th>
<th align="center" width="50%">3</th>
<th align="center" width="30%">4</th>
</tr>
<apex:repeat value="{!VARIABLE}" var="c">
<tr>
<td align="center">{!c.SOMETHING}</td>
</tr>
</apex:repeat>
</table>
</div>
</body>
</html>
Best Answer
Please try to use below code snippet