Hello Everyone,
I was able to set my PDF export to landscape format by adding the following to PDF stylesheet:
@page { /*A4-sized pages in landscape orientation are 297 mm wide by 210 mm long*/ size: 297mm 210mm; }
However, the first couple pages are better presented in portrait format. So my question, is it possible to specify first x number of pages in portrait then everything else in landscape after?
Hi @Jerry Yen,
For @page, there is only a pseudo-class defined for the title page. You can use @page :first for the first page and @page for the second page and beyond:
@page
{
size: A4 landscape;
}
@page :first
{
size: A4 portrait;
}
Looks like :nth-child(n) doesn't work with @page.
@Jerry Yen, I don't think it's possible. You can only define different style for the first title page.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Is there no option to use page breaks then "named pages" in Confluence?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Jerry Yen, you can add a custom class to your page and define styles for it. Try this:
@page Portrait
{
size: A4 portrait;
}
.customPortraitLayout
{
page: Portrait;
}
I tested this and it worked for me, but please be aware that it has not been thoroughly tested and you use it at your own risk. This solution only applies to pages where you add the class manually.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.