How to export an entire page in landscape?
Asked by Karie Kelly:

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](/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.


Answers:
author: Guilherme Nedel [Atlassian]
body: 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

comments: author: Karie Kelly
body: 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.


author: Frederik Teuber
body: 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&lt;div class="landscape"&gt;  #if (!$paramshowTitle)    &lt;div class="print-only"&gt;&lt;h1&gt;$content.getTitle()&lt;/h1&gt;&lt;/div&gt;  #end$body&lt;/div&gt;
```

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


author: Guilherme Nedel [Atlassian]
body: Hello Karie, there is a similar topic in [this thread](/questions/140541/confluence-how-can-we-export-pdf-in-portrait-or-landscape-in-the-same-space?page=1#140627), it suggests that one use the following:

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

comments: author: Karie Kelly
body: 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.


Tags: pdf-export