You need to sign in to do that
Don't have an account?
michaellee.ampf
Visualforce PDF Page Orientations
Hi,
I know that I'm able to set page orientation for a VisualForce PDF document by having either
@page {
size:portrait;
}
@page {
size:landscape;
}
in the CSS file. Now, what I'm wondering is if there is any way for me to have the first page of a PDF document in portrait, and the second page in landscape. Is that possible? Is it possible to set the style for a particular page?
Thanks,
Michael
Thanks --
As I dug through the web and CSS documentation, I was able to do something like this instead:
@page rotated {
size:landscape;
margin-top:10px;
margin-right:10px;
margin-left:10px;
margin-bottom:20px;
}
table.history2
{
page:rotated;
width: 10in;
}
-- and additional placement of "page:rotated" got me exactly what I was looking for.
Thanks,
Michael
All Answers
You can use @page :first for first page and @page for rest of pages, see the eample below :
@page :first
{
size:portrait;
}
@page
{
size:landscape;
}
Thanks --
As I dug through the web and CSS documentation, I was able to do something like this instead:
@page rotated {
size:landscape;
margin-top:10px;
margin-right:10px;
margin-left:10px;
margin-bottom:20px;
}
table.history2
{
page:rotated;
width: 10in;
}
-- and additional placement of "page:rotated" got me exactly what I was looking for.
Thanks,
Michael