• 2
    • 8
    • We collect Confluence feedback from various sources, and we evaluate what we've collected when planning our product roadmap. To understand how this piece of feedback will be reviewed, see our Implementation of New Features Policy.

      NOTE: This suggestion is for Confluence Server. Using Confluence Cloud? See the corresponding suggestion.

      It Would be good to have a macro that you can use to allow certain sections on a page to be printed in Landscape mode.

      ie Wide tables can have a

      {PDFExportLandscape}

      tag around it which will make that section print on a new page and be in landscape mode.

      Currently the only way to print in landscape is to specify this on the space's stylesheet. this will then be applied to all pages in that space and is very limiting, ie 1 space for landscape documents and 1 space for portrait documents.

            [CONFSERVER-22115] PDF Export Landscape

            Would be great if the Atlassian documentation actually reflected what the measurement value is supposed to be in the Global PDF stylesheet. The current documentation only gives MM - what exactly is the abbreviation for inches supposed to be? Thank goodness Anatoli wrote it for us. 

            Kim Wallace added a comment - Would be great if the Atlassian documentation actually reflected what the measurement value is supposed to be in the Global PDF stylesheet. The current documentation only gives MM - what exactly is the abbreviation for inches supposed to be? Thank goodness Anatoli wrote it for us. 

            Yeee, thanks @Cyrille, you solved my issue!!

            In the end my macro looks like this:

            ## @noparams <style> 
            @page { size: 297mm 210mm; margin-top: 2mm; margin-bottom: 0mm; margin-left: 2mm; margin-right: 2mm; padding: 2px; background-image: none; } 
            body,p,li,td,table,tr,.bodytext,.stepfield { font-size: 10px; /*line-height: 1.1;*/ color: #000; font-weight: normal; } 
            </style>
            

            Róbert Szabó added a comment - Yeee, thanks @Cyrille, you solved my issue!! In the end my macro looks like this: ## @noparams <style> @page { size: 297mm 210mm; margin-top: 2mm; margin-bottom: 0mm; margin-left: 2mm; margin-right: 2mm; padding: 2px; background-image: none; } body,p,li,td,table,tr,.bodytext,.stepfield { font-size: 10px; /*line-height: 1.1;*/ color: #000; font-weight: normal; } </style>

            To answer to the issue 1 in @karie kelly comment

            This does not work if you want the entire page to be exported as landscape. Even if you put all of the content in this div, the page title exports on a single portrait page.

            You can create a specific user macro for that:

            ## @noparams
            <style>
            @page {
            size: 297mm 210mm; 
            } 
            </style>
            

            You can put anywhere this user macro in the page you want to export in landscape orientation and the PDF export will be entirely landscape oriented.

            Cyrille Martin added a comment - To answer to the issue 1 in @karie kelly comment This does not work if you want the entire page to be exported as landscape. Even if you put all of the content in this div, the page title exports on a single portrait page. You can create a specific user macro for that: ## @noparams <style> @page { size: 297mm 210mm; } </style> You can put anywhere this user macro in the page you want to export in landscape orientation and the PDF export will be entirely landscape oriented.

            We found it possible to export specific content to landscape by adding the following to the PDF Stylesheet
            /* makes tables fill 100% of page width - good for landscape */

            table.confluenceTable {
            width:100%;
            table-layout: auto;
            }

            /* to in specific landscape pages. Just use the div macro <div class="landscape"> ... </div> */
            /* "{div" in edit mode to use the div*/

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

            div.landscape {

            page: landscape;
            width:140%;
            }

            @page landscape {
            size: A4 landscape;
            }

            and then using the

            {div:class=landscape}

            macro to encompass what we want to export as landscape.

            Two issues though:
            1. This does not work if you want the entire page to be exported as landscape. Even if you put all of the content in this div, the page title exports on a single portrait page.

            2. We have not found a solution for making images utilize the full width. They print like they are still being printed in portrait.

            Consequently, we are still looking for a solution to export an entire page as PDF (including the page title) that doesn't use CSS. Today, we use the previous commenters suggestion in a CSS Stylesheet macro on the page; but, this doesn't work with the include page macro or global exports because that CSS becomes applied to everything or ignored if there was another page with a different CSS macro. If you're first page had the CSS macro to make the page landscape, ALL pages in your global export will be in landscape. The

            {includepage}

            just ignores the CSS and exports in portrait.

            Karie Kelly added a comment - We found it possible to export specific content to landscape by adding the following to the PDF Stylesheet /* makes tables fill 100% of page width - good for landscape */ table.confluenceTable { width:100%; table-layout: auto; } /* to in specific landscape pages. Just use the div macro <div class="landscape"> ... </div> */ /* "{div" in edit mode to use the div*/ @page { size: 210mm 297mm; /* DinA4 */ } div.landscape { page: landscape; width:140%; } @page landscape { size: A4 landscape; } and then using the {div:class=landscape} macro to encompass what we want to export as landscape. Two issues though: 1. This does not work if you want the entire page to be exported as landscape. Even if you put all of the content in this div, the page title exports on a single portrait page. 2. We have not found a solution for making images utilize the full width. They print like they are still being printed in portrait. Consequently, we are still looking for a solution to export an entire page as PDF (including the page title) that doesn't use CSS. Today, we use the previous commenters suggestion in a CSS Stylesheet macro on the page; but, this doesn't work with the include page macro or global exports because that CSS becomes applied to everything or ignored if there was another page with a different CSS macro. If you're first page had the CSS macro to make the page landscape, ALL pages in your global export will be in landscape. The {includepage} just ignores the CSS and exports in portrait.

            We have run across this requirement too. It is especially important to be able to set the page orientation to landscape before a large table and then set it back to portrait for the remaining pages following the table.

            Kerrin Hardy added a comment - We have run across this requirement too. It is especially important to be able to set the page orientation to landscape before a large table and then set it back to portrait for the remaining pages following the table.

            The workaround proposed by Anatoli will apply to all exported pages. There is a need for finer control, so that individual pages can be set to landscape while the rest of the space is exported as portrait for example, or vice-versa.

            Charles Hall added a comment - The workaround proposed by Anatoli will apply to all exported pages. There is a need for finer control, so that individual pages can be set to landscape while the rest of the space is exported as portrait for example, or vice-versa.

            Anatoli added a comment -

            Hi, there is a quick workaround for this:

            add the following to your PDF stylesheet to make it landscape

            @page
            {
             size: 11in 8.5in;  
            }
            

            Anatoli added a comment - Hi, there is a quick workaround for this: add the following to your PDF stylesheet to make it landscape @page { size: 11in 8.5in; }

            Hi,

            We are also interested in being able to print various pages in a space as landscape and others as portrait.

            Can you please update?

            Regards
            Rebecca

            Rebecca Waterman added a comment - Hi, We are also interested in being able to print various pages in a space as landscape and others as portrait. Can you please update? Regards Rebecca

              Unassigned Unassigned
              e64d75b58cd6 CV Support
              Votes:
              42 Vote for this issue
              Watchers:
              25 Start watching this issue

                Created:
                Updated: