A major difference between a printed document and a web document is that the former is formatted for paper, while the latter is formatted for a computer screen. 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 you several ways to affect the layout of your printed pages, including:
Page Breaks
By default, Highwire will break 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 your document will break for a new page.
To add a page break
Page Breaks in Table Cells
By default, Highwire may break table cells across multiple pages. To prevent this from happening, you should use the the page-break-inside:avoid style in your table row <tr> tags or in your table row style definitions. This will prevent Highwire from breaking cells in the specified row(s) across pages, except when a cell is too big for a single page.
<tr style="page-break-inside:avoid">
Page Size
By default, your Highwire documents use the Letter page size (8.5 x 11 inches). However, Highwire gives you complete control over the page sizes for your Highwire documents.
Note: In extreme circumstances where Highwire cannot fit the contents of your document in the specified page size, Highwire may choose a larger page size instead of honoring your page size request. You can also provide a page size fallback scheme to give you more control over the page size Highwire will choose when the contents grow too big. See "Page Size Fallback" for more details.
Note: You can change Highwire's default page size using the page_defaults.txt Corda Server configuration file.
To set your document's page size
- Open your HTML/XHTML document in an HTML or text editor, such as Notepad.
- Locate the
<body>tag for your document. - If not already included, add a
styleattribute inside of the<body>tag. - Inside the
styleattribute, add a definition for your page margin, as shown below: - Save your changes.
<body style="">
<body style="page-size:A5">
This line of code will set the page size to A5. You could change this size by replacingA5with another size definition (such asletter). 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 wanted to set a custom page size, you could use the following line of code:
<body style="page-size-width:10in; page-size-height:10in;">
Thepage-size-widthstyle sets the width of the page, and thepage-size-heightstyle sets the height of the page. You could change the height or width by replacing10inwith another size definition (such as640px). Size definitions should include a number followed by a unit of measurement. Valid units of measurement include: in, cm, mm, px, pc, pt, em, and ex.
Note: You could also set your page margins by specifying page-size styles inside of your document's style sheet.
Document Margins
By default, the body of your Highwire documents will begin and end .25 inches away from the edge of the document. This is known as your document's page margin. However, you can set the page margin to anything you wish.
Note: If you would like your page margins to automatically shrink when the contents of the page grow too wide, you can do so using a page size fallback scheme. See "Page Size Fallback" for more details.
Note: You can change Highwire's default page orientation using the page_defaults.txt Corda Server configuration file.
To set your document's margins
- Open your HTML/XHTML document in an HTML or text editor, such as Notepad.
- Locate the
<body>tag for your document. - If not already included, add a
styleattribute inside of the<body>tag. - Inside the
styleattribute, add a definition for your page margin, as shown below: - Save your changes.
<body style="">
<body style="page-margin:1in">
This line of code will insert a 1 inch margin on all sides of your page. You could change this size by replacing1inwith another size definition (such as72pt). Size definitions should include 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 .25 inches.
If you wanted to set the margins individually, you could do so with the following line of code:
<body style="page-margin-top:72pt; page-margin-bottom:72pt; page-margin-left:1.25in; page-margin-right:0.1in;">
Note: You could also set your page margins by specifying page-margin styles inside of your document's style sheet.
Document Orientation
By default, the page orientation of your Highwire document will be portrait (the page is rotated so that it is taller than it is wide). However, you can change the page orientation to landscape (wider than it is tall).
Note: If you would like your pages to automatically switch to landscape when the contents of page grow too wide, you can do so using a page size fallback scheme. See "Page Size Fallback" for more details.
Note: You can change Highwire's default page orientation using the page_defaults.txt Corda Server configuration file.
To change document orientation
- Open your HTML/XHTML document in an HTML or text editor, such as Notepad.
- Locate the
<body>tag for your document. - If not already included, add a
styleattribute inside of the<body>tag. - Inside the
styleattribute, add a definition for your page margin, as shown below: - Save your changes.
<body style="">
<body style="page-orientation:landscape">
This line of code will set the page orientation to landscape. You could also set the page orientation to portrait, although this is the default setting.
CORDA