Multiple Pages with Different Page Margins
Use page-specific CSS and `pagebody` tags to apply different margins or orientation within one PDF template.
Problem
Solution
<style type="text/css">
@page parentTemplate {
margin: 1in;
}
body.parentTemplate {
page: parentTemplate;
}
@page componentTemplate {
margin: 0in;
size: landscape;
}
body.componentTemplate {
page: componentTemplate;
}
</style>
<pagebody class="parentTemplate">
Test Page 1
</pagebody>
<pagebody class="componentTemplate">
Test Page 2
</pagebody>
<pagebody class="parentTemplate">
Test Page 3
</pagebody>How it works
Example result
Tips
Related resources
Last updated
Was this helpful?

