Add renderAs="pdf" in <apex:page> tag as below.
Attention:
@page must be inside of <html><head><style>, or include as a static resource.
Use page-break to control when is next page. If you didn't set page break, it will only display in next page when out of bound.
<apex:page renderAs="pdf">
Add CSS style to set format of page.@page {
size: letter;
@top-center {content: "PDF Sample";}
@bottom-center {content: "Page " counter(page) " of " counter(pages);}
}
*Most used page size: landscape/8.27in 11.69in (A4 width and height)Attention:
@page must be inside of <html><head><style>, or include as a static resource.
<apex:page renderAs="pdf">
<html>
<head>
<style>
@page {...}
</style>
</head>
</html>
</apex:page>
Use page-break to control when is next page. If you didn't set page break, it will only display in next page when out of bound.
<style>
.page-break {display:block; page-break-after:always;}
</style>
<body>
<div class="page-break">
<apex:outputText >Page 1</apex:outputText>
</div>
<div>Page 2</div>
</body>
No comments:
Post a Comment