Gretyl's Portal

Heretto Help

Show Page Sections

Page Orientation, Size, Margins

In Heretto PDF Generator, you can control the page size, page orientation, and margin size of your document. Follow information provided in this section to build PDF Generator publishing scenarios based on Gray and Color templates. For more information about the templates, see Gray and Color Templates.

You can change the styling both in the PDF Generator publishing scenario and by assigning outputclass attributes to maps and topics.

Table 1. Styling used in the default Gray and Color templates
Resource location:@import url("https://jorsek.github.io/pdfgen.github.io/styles1.1/modules/layout/orientation_size.css");

Change Page Size

You can change the page size in a PDF Generator publishing scenario. The default is A4.

  1. In the top-left corner, click the Main Menu and go to PDF Generator.
  2. In the PDF Generator scenarios screen, click the publishing scenario you want to edit.
  3. In the CSS tab, add a document format keyword or a specific document width and height. For example US-Letter or 920 px 920 px.

    For a list of page sizes, see Page Size Keywords.

    /* Custom document layout. */
    /* Page */
    @page {
        size: US-Letter;
    }
    /* Table of contents */
    @page toc {
        size: US-Letter;
    }
    /* Cover */ 
    @page cover_page {
        size: US-Letter;
    }
    /* Custom document layout. */
    /* Page */
    @page {
        size: 920px 920px;
    }
    /* Table of contents */
    @page toc {
        size: 920px 920px;
    }
    /* Cover */ 
    @page cover_page {
        size: 920px 920px;
    }
    

    The size of the cover page, the table of contents (TOC), and the regular page are assigned independently. To change the page size for the whole document, assign values for all three elements.

    Tip:

    You can combine the attributes for page size and orientation in one line.

    /* Force custom document layout. */
    @page {
        size: US-Letter landscape !important;
    }
  4. Click Save Scenario.
  5. Click the Select map to preview button to select the map you want to test with the updated scenario. Once selected, click the Generate PDF button.

Change Page Orientation

You can change the page orientation in a PDF Generator publishing scenario. The default is portrait.

  1. In the top-left corner, click the Main Menu and go to PDF Generator.
  2. In the PDF Generator scenarios screen, click the publishing scenario you want to edit.
  3. In the CSS tab, add page orientation.
    
    /* Custom document layout. */
    /* Page */
    @page {
        size: landscape;
    }
    /* Table of contents */
    @page toc {
        size: landscape;
    }
    /* Cover */ 
    @page cover_page {
        size: landscape;
    }
    

    The orientation of the cover page, the table of contents (TOC), and the regular page are assigned independently. To change the page orientation for the whole document, assign values for all three elements.

    The page orientation for specific DITA elements may be defined with outputclass attributes. To make the CSS always overwrite the outputclass attributes, add !important to the CSS attribute.

    Tip:

    You can combine the attributes for page size and orientation in one line.

    /* Force custom document layout. */
    @page {
        size: US-Letter landscape !important;
    }
  4. Click Save Scenario.
  5. Click the Select map to preview button to select the map you want to test with the updated scenario. Once selected, click the Generate PDF button.

Outputclass Attributes for Page Orientation, Size, Margins

You can assign outputclass attributes to root maps or root topics to set page orientation, size, and margins of their elements.

You can learn how to assign outputclass attributes here: Outputclass Attributes for PDF Generator.

With ooutputclass attributes, you can change the orientation of individual maps or topics, regardless of what is defined in the publishing scenario.

Setting the page orientation to landscape or decreasing margins is useful if you want to:
  • Insert a large table
  • Insert a large image
  • Reduce the number of pages
Table 2. Outputclass Attributes for Page Orientation, Size, and Margins

PDF Generator Gray and Color templates are configured to respect these outputclass attributes by default. As a result, once you add them to a file, they are immediately applied to your output. There is no need to modify your PDF Generator scenario.

Note:

When an element inside a topic has a different orientation or margin size assigned than the rest of the topic, that element is moved to a new page.

Outputclass Attribute

Description

Target DITA Element

landscape_smallA4 landscape body page size with small margins

map, topic, element inside a topic

landscapeA4 landscape body page size with regular margins

map, topic, element inside a topic

portrait [default]A4 portrait body page size with regular margins

map, topic, element inside a topic

portrait_largeA4 portrait body page size with large margins

map, topic, element inside a topic

portrait_smallA4 portrait body page size with small margins

map, topic, element inside a topic

toc_landscape_largeA4 landscape TOC page size with large margins

map

toc_landscape_smallA4 landscape TOC page size with small margins

map

toc_landscapeA4 landscape TOC page size with regular margins

map

toc_portrait [default]A4 portrait TOC page size with regular margins

map

toc_portrait_largeA4 portrait TOC page size with large margins

map

toc_portrait_smallA4 portrait TOC page size with small margins

map