Page Format

Start page  Previous page  Next page

 

The page format feature allows you to specify the paper size, paper orientation and the margins. You can also determine the spacing (or margin) between the main text and the header and footer.

 

Settings for the page format are made using the function N2PDFSetOption. Below is a listing of the individual options available for formatting the page. The individual values are set via <OptionStr> and <SubOptionStr> of the N2PDFSetOption function.

 

112

Please keep in mind that some options expect you to input measurements and that these must be specified in the units of measurement that were configured in "System Settings" using the option N2PDFOPTION_SYSTEM_METRICS_MODE.

 

 

N2PDFOPTION_PAGE_FORMAT_STANDARD

Use this parameter to select one of the predefined paper formats:

 

N2PDFVALUE_PAGEFORMAT_A3

N2PDFVALUE_PAGEFORMAT_A4

N2PDFVALUE_PAGEFORMAT_A5

N2PDFVALUE_PAGEFORMAT_A6

N2PDFVALUE_PAGEFORMAT_LETTER

N2PDFVALUE_PAGEFORMAT_LEGAL

N2PDFVALUE_PAGEFORMAT_EXECUTIVE

 

 

Example:

Call N2PDFSetOption ( JobID, N2PDFOPTION_PAGE_FORMAT_STANDARD,_

N2PDFVALUE_PAGEFORMAT_A4, "" )

 

 

N2PDFOPTION_PAGE_FORMAT_CUSTOM

You can specify a user-defined paper format with this parameter. To do so, use the values <OptionStr> as the width and <SubOptionStr> as the height.

 

Example for paper that is 20 cm wide and 15 cm high:

Call N2PDFSetOption ( JobID, N2PDFOPTION_PAGE_FORMAT_CUSTOM,"20","15" )

 

112

In addition to the definition of the paper format for all pages, n2pdf allows the definition of an individual format for single pages. Pass the page number as a negative value for "<OptionStr>" or "<SubOptionStr>" for the pages that you want to define an individual format for. If you want to define both height and width for a page, call the command twice.

 

An example for a format of 10 cm width and 5 cm height for page 2

Call N2PDFSetOption ( JobID, N2PDFOPTION_PAGE_FORMAT_CUSTOM,"10","-2" )

Call N2PDFSetOption ( JobID, N2PDFOPTION_PAGE_FORMAT_CUSTOM,"-2","5" )

 

 

N2PDFOPTION_PAGE_ORIENTATION

This parameter sets the page's orientation.

 

N2PDFVALUE_PAGE_ORIENTATION_PORTRAIT

Portrait

N2PDFVALUE_PAGE_ORIENTATION_LANDSCAPE

Landscape

 

 

Example:

Call N2PDFSetOption ( JobID, N2PDFOPTION_PAGE_ORIENTATION,_

N2PDFVALUE_PAGE_ORIENTATION_PORTRAIT, "" )

 

 

Margins can be set for the page using the four parameters below. Assign the value in <OptionStr>.

 

N2PDFOPTION_PAGE_MARGIN_TOP

Margin of the main text relative to the top of the page

N2PDFOPTION_PAGE_MARGIN_BOTTOM

Margin of the main text relative to the bottom of the page

N2PDFOPTION_PAGE_MARGIN_LEFT

Left margin of the page

N2PDFOPTION_PAGE_MARGIN_RIGHT

Right margin of the page

 

Example for a top margin of 2 cm:

Call N2PDFSetOption ( JobID, N2PDFOPTION_PAGE_MARGIN_TOP,"2","" )

 

112

You may set the margins individually for single pages. Simply pass the page number as a negative value in the option <OptionSubStr>.

 

Example for a 1 cm upper margin on page 4:

Call N2PDFSetOption ( JobID, N2PDFOPTION_PAGE_MARGIN_TOP,"1","-4" )

 

 

With these two parameters you can specify the interval or margin between the header and footer and the start and end of the main text respectively. Assign the value in <OptionStr>.

 

N2PDFOPTION_PAGE_MARGIN_HEADER

Margin of the header to the top of the page

N2PDFOPTION_PAGE_MARGIN_FOOTER

Margin of the footer to the bottom of the page

 

An example for a 1 cm margin from the beginning of the page to the header:

Call N2PDFSetOption ( JobID, N2PDFOPTION_PAGE_MARGIN_HEADER,"1","" )

 

 

clip0022

 

1) N2PDFOPTION_PAGE_MARGIN_HEADER

This option sets the margin of the header (the position where the first line of the header starts) relative to the beginning of the page.

 

2) N2PDFOPTION_PAGE_MARGIN_TOP

This option sets the margin of the main text (the position where the first line of the main text starts) relative to the beginning of the page.

 

3) N2PDFOPTION_PAGE_MARGIN_BOTTOM

This option sets the margin of the main text (the position where the last line of the main text starts) relative to the end of the page.

 

4) N2PDFOPTION_PAGE_MARGIN_FOOTER

This option sets the margin of the footer (the position where the last line of the footer ends) relative to the end of the page.

 

5) Multiline headers

The option N2PDFOPTION_PAGE_MARGIN_HEADER defines the starting position for the first line of the header. If a header consists of multiple lines, the header "grows" in the direction of the arrow. It is possible, that the header thereby meets the position defined by N2PDFOPTION_PAGE_MARGIN_TOP. If this is the case, the main text is moved down, meaning the value set by N2PDFOPTION_PAGE_MARGIN_TOP is then no longer valid.

 

6) Multiline footers

The option N2PDFOPTION_PAGE_MARGIN_FOOTER defines the position for the last line of the footer. If a footer consists of multiple lines, the footer "grows" in the direction of the arrow. It is possible, that the footer thereby meets the position defined by N2PDFOPTION_PAGE_MARGIN_BOTTOM. If this is the case, the main text is moved down, meaning the value set by N2PDFOPTION_PAGE_MARGIN_BOTTOM is then no longer valid.

 

 

N2PDFOPTION_PAGE_NUMBERING_OFFSET

You can use this parameter to transfer a value for page numbering to which the page number, number of pages and page details are added to the Table of Contents (e.g. remove cover sheet from the numbering). The value for this offset can be either positive or negative.