How to export an entire page in landscape?

Karie Kelly
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
July 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
Guilherme Nedel [Atlassian]
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
July 11, 2013

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
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
July 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
Frederik Teuber September 1, 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

0 votes
Guilherme Nedel [Atlassian]
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
July 11, 2013

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

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

Karie Kelly
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
July 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.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events