6. Page Layout

You can influence the layout of the page by setting the page size, as well as the padding, margin, border and background properties of the page.

The page size can be specified using the @page property. You can either set the page size in length units or by using the page size keyword (e.g. A4). Please see the following examples.

This style sets the page size to US-Letter paper size:

@page { size: letter }

In order to have the document in landscape format, you can use the following property:

@page { size: letter landscape }

It is also possible to define the page size using numerical values with lenght units, e.g.:

@page { size: 12cm 30cm }

In case you indicate only one value, it will be used as the documents height and width.

@page { size: 12cm }

The page style of your document can be set using the following properties: padding, border, margin and background.

@page {
    padding: 5mm;
    border: solid 1mm;
    margin: 25mm 20mm;
    backgound: url(myserver/images/myimage.gif);
}

In the example above, the padding of your document is 5mm for all sides, the border is solid and 1mm thick, the margin is 25mm at the top and bottom of your page, and 20mm at the sides, and the background is the image located on your server at "myserver/images/myimage.gif".

Below you can find an overview of the page size keywords supported by PDFreactor:

Table V.1. Overview of the supported page size keywords

CSS IdentifierSize
A1594mm x 841mm
A2420mm x 594mm
A3148mm x 210mm
A4210mm x 297mm
A5297mm x 420mm
A6105mm x 148mm
A774mm x 105mm
A852mm x 74mm
A937mm x 52mm
A1026mm x 37mm
B1707mm x 1000mm
B2500mm x 707mm
B3353mm x 500mm
B4176mm x 250mm
B5250mm x 353mm
B6125mm x 176mm
B788mm x 125mm
B862mm x 88mm
B944mm x 62mm
B1031mm x 44mm
C1648mm x 917mm
C2458mm x 648mm
C3324mm x 458mm
C4229mm x 324mm
C5162mm x 229mm
C6114mm x 162mm
C781mm x 114mm
C857mm x 81mm
C940mm x 57mm
C1028mm x 40mm
Letter8,5in x 11in
Legal8,5in x 14in
Ledger11in x 17in
Invoice5,5in x 8in
Executive7,25in x 10,5in
Broadsheet17in x 22in