Pagination and Margins

A major difference between Web documents and printed documents is that Web documents are formatted for computer screens, while printed documents are formatted for paper. Thus, most Web documents don't take into account issues that are fundamental to the printed page, such as page breaks and page size.

Fortunately, Highwire™ offers several ways to control the layout of printed pages:

Page Breaks

By default, Highwire breaks a document for a new page whenever it runs out of room on the current page. However, Highwire also gives you the ability to control where the document breaks for a new page.

To add a page break

  1. Open the HTML document in an HTML or text editor, such as Notepad.

  2. Locate the place(s) where you want to insert a page break.

  3. Insert one of the following lines of code:

    <br style="page-break-before:always" />

    Or

    <!-- <ctnewpage /> -->

  4. Save the changes.

Page Breaks in Tables

By default, Highwire breaks both tables and individual table rows across multiple pages. To prevent this from happening, use the page-break-inside:avoid style in the table (<table>) and table row (<tr>) tags. For example:

<tr style="page-break-inside:avoid">

Note: You can also use page-break-inside:avoid in table row style definitions.

This prevents Highwire from breaking tables or table rows across pages, unless the table or table row is too large to fit on a single page.

Page Size

By default, Highwire documents use the Letter page size (8.5 x 11 inches). However, Highwire gives you robust control over page sizes for Corda® images.

Note: To change Highwire's default page size, modify the Corda Server™ page_defaults.txt configuration file.

Note: In extreme circumstances where Highwire cannot fit the contents of a document in the specified page size, Highwire may choose a larger page size instead of honoring the page size request. Highwire supports a page size fallback scheme that provides more control over Highwire actions when document contents grow too big. For more information, see Page Size Fallback.

To set a document's page size

  1. Open the HTML document in an HTML or text editor, such as Notepad.

  2. Locate the <body> tag for the document.

  3. If not already included, add a style attribute inside the <body> tag:

    <body style="">

  4. Inside the style attribute, add a definition for the page size, as shown below:

    <body style="page-size:A5">

    This line of code sets the page size to A5 . You can change this size by replacing A5 with another size definition (such as letter). Valid page size definitions include: 11x17, A3, A4, A5, B4, B5, halfletter, ledger, legal, letter, or note. The default page size is letter.

    If you want to set a custom page size, use the following code:

    <body style="page-size-width:10in; page-size-height:10in;">

    The page-size-width style sets the width of the page, and the page-size-height style sets the height of the page. You can change the height or width by replacing 10in with another size definition (such as 640px). Size definitions require a number followed by a unit of measurement. Valid units of measurement include: in, cm, mm, px, pc, pt, em, and ex.

  5. Save the changes.

Note: You can also set page sizes by specifying page-size styles in the document's style sheet.

Document Margins

By default, the document margin for a Corda image is .25 inches away from the edge of the page, but this margin is configurable.

Note: Document margins can automatically shrink when the contents of the page grow too wide. For more information, see Page Size Fallback.

To set a document's margins

  1. Open the HTML document in an HTML or text editor, such as Notepad.

  2. Locate the <body> tag for the document.

  3. If not already included, add a style attribute inside the <body> tag:

    <body style="">

  4. Inside the style attribute, add a definition for the page margin, as shown below:

    <body style="page-margin:1in">

    This line of code inserts a 1 inch margin on all sides of the page. Change this size by replacing 1in with another size definition (such as 72pt). Size definitions require a number followed by a unit of measurement. Valid units of measurement include: in, cm, mm, px, pc, pt, em, and ex. The default page margin is .25in.

    If you want to set the page margins individually, use code similar to the following:

    <body style="page-margin-top:72pt; page-margin-bottom:72pt; page-margin-left:1.25in; page-margin-right:0.1in;">

  5. Save the changes.

Note: You can also set page margins by specifying page-margin styles in the document's style sheet.

Document Orientation

By default, the page orientation for a Corda image is portrait (i.e., the page is taller than it is wide); however, page orientation can also be set to landscape (wider than it is tall).

Note: Page orientation can automatically switch to landscape if the contents of a page grow too wide. For more information, see Page Size Fallback.

Note: To change Highwire's default page orientation, modify the Corda Server page_defaults.txt configuration file.

To change document orientation

  1. Open the HTML document in an HTML or text editor, such as Notepad.

  2. Locate the <body> tag for the document.

  3. If not already included, add a style attribute inside the <body> tag:

    <body style="">

  4. Inside the style attribute, add a definition for the page orientation, as shown below:

    <body style="page-orientation:landscape">

    This line of code sets the page orientation to landscape. You can also set the page orientation to portrait, although this is the default setting.

  5. Save the changes.