Are you in the loop? Keep up with the latest by making sure you're subscribed to Community Announcements. Just click Watch and select Articles.

×
Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

PDF export with both portrait and landscape format pages

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?

1 answer

0 votes
Kseniia Trushnikova
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
Nov 09, 2023 • edited

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.

Thank you.  If I need the first 2 pages to be in portrait mode then page 3+ to be in landscape, is there a way to do this?

Kseniia Trushnikova
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
Nov 09, 2023

@Jerry Yen, I don't think it's possible. You can only define different style for the first title page.

Is there no option to use page breaks then "named pages" in Confluence?

https://drafts.csswg.org/css-page-3/#using-named-pages

Kseniia Trushnikova
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
Nov 09, 2023

@Jerry Yen, you can add a custom class to your page and define styles for it. Try this:

  1. Open the page in the Confluence Source Editor, please refer to https://confluence.atlassian.com/doc/confluence-storage-format-790796544.html 
  2. Wrap the content you want to be in the portrait layout with the tag <div class="customPortraitLayout">...</div> and update the page.
  3. Add this on the PDF Stylesheet tab:
@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.

Like Jerry Yen likes this

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events