It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

How to export an entire page in landscape?

Karie Kelly Jul 11, 2013

I've read this topic on some page content printing in landscape: https://answers.atlassian.com/questions/170484/how-can-we-export-a-specific-pdf-page-in-portrait-or-landscape-for-big-pictures-or-tables

However, I need for the entire page to export in landscape. If I include the div and put all content in it, the page title still exports because it believes it should be in portrait and so I have the first page that is portrait an only includes the page title, then the page content that is in landscape, then the last page is always blank and in portrait.

How do I get the page title to be included on the first page in landscape mode? I was trying various CSS entries in the space and on the page itself without any luck regarding pagetitle.

3 answers

1 accepted

0 votes
Answer accepted

Yes, since the available workaround resources to a CSS it is gets lost when the context of the PDF export (i.e. global, multipage, etc) changes. :( This feature request may be of interest for the case:

  • https://jira.atlassian.com/browse/CONF-22115
Karie Kelly Jul 11, 2013

I provided the same comment on that issue. Thanks for pointing me to it. This is such a critical need for anyone reusing content and for generating documents, a core feature of a wiki, I'm suprised it hasn't gotten more attention/support from Atlassian.

0 votes

Hello Karie, there is a similar topic in this thread, it suggests that one use the following:

@page {
size: 210mm 297mm; /* DinA4 */
}

Karie Kelly Jul 11, 2013

I did include that in the CSS; however, if you use that, when you include that page using the includepage macro, it is ignored (whereas div tags aren't ignored). Also, if you select that page in a global export, the CSS is assumed for all selected pages - thus, everything gets transformed to landscape when that's not what you want. Div tags are respected in a global export, unless there is that CSS, and then its overwritten. Consequently, I was trying to use a div tag instead of a css in order to have a complete solution that works for single page export, global export, and exports when it is included.

0 votes
Frederik Teuber Sep 01, 2014

Hi Karie,

I have the same problem. I'm using a user macro as a workaround to get the page title to be included on the page in landscape. The macro adds a div-element with the class "landscape" and then adds the page title to this page. I still have the first page in portrait with the title only.

You can use a user macro like this:

## Macro title: pdf-landscape-export
## Macro has a body: Y
## Body processing: Rendered
##
## Developed by: Frederik Teuber
## Date created: 26/05/2014

## This is the pdf-landscape-export macro
## @param showTitle:title=Show Title?|type=boolean|desc=Display the page title?|default=true

<div class="landscape">
  #if (!$paramshowTitle)
    <div class="print-only"><h1>$content.getTitle()</h1></div>
  #end
$body
</div>

You can choose then in the macro browser wether you want the title to be displayed on the landscape page or not.

Add this line to your custom css to avoid the page title to be displayed twice on your page:

.print-only {
display: none;
}

There is also some css you have to add for your pdf export like described in the question you mentioned in your post. Use something like

div.landscape {
page: landscape;
width:150%;
}

and fit for your needs.

I would appreciate if anybody had a clean solution for avoiding the first page to be in portrait with title only.

Cheers,

Frederik

Suggest an answer

Log in or Sign up to answer
This widget could not be displayed.
This widget could not be displayed.
Community showcase
Published in Confluence

Confluence CVEs and common questions

Two vulnerabilities have been published for Confluence Server and Data Center recently: March 20, 2019 CVE-2019-3395 / CVE-2019-3396 April 17, 2019 CVE-2019-3398 The goal of this article is...

856 views 0 19
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you