Formating Contents

Start page  Previous page  Next page

 

This section describes options and parameters which you can use to adapt the "Formating and Layout of the Table of Contents", using text templates.

 

112

Additional explanations of text templates and other settings can be found in the Text templates section.

 

112

If you use text template N2PDFVALUE_TOC_PARAGRAPH_NAME, settings are made at all levels of the Table of Contents and, possibly, individual settings already in place may be overtyped.

 

 

N2PDFVALUE_TOC_LEVEL1_PARAGRAPH_NAME

N2PDFVALUE_TOC_LEVEL2_PARAGRAPH_NAME

N2PDFVALUE_TOC_LEVEL3_PARAGRAPH_NAME

...

...

N2PDFVALUE_TOC_LEVEL10_PARAGRAPH_NAME

These parameters enable you to set individual settings for each respective level of the Table of Contents. These text templates have fixed, defined names.

 

Example - set "Verdana" font, font size "10" for the first level:

Call N2PDFSetOption ( JobID, N2PDFOPTION_PARAGRAPH_FONT_NAME,_

"Verdana", N2PDFVALUE_TOC_LEVEL1_PARAGRAPH_NAME )

 

Call N2PDFSetOption ( JobID, N2PDFOPTION_PARAGRAPH_FONT_SIZE,_

"10", N2PDFVALUE_TOC_LEVEL1_PARAGRAPH_NAME )

 

 

TOC_Template

 

 

N2PDFVALUE_TOC_HEADER_PARAGRAPH_NAME

N2PDFVALUE_TOC_FOOTER_PARAGRAPH_NAME

These parameters enable you to define the formatting of text appearing before and after the Table of Contents. This is a fixed, defined name for a text template.

 

Example - set "Verdana" font for the header in the Table of Contents:

Call N2PDFSetOption ( JobID, N2PDFOPTION_PARAGRAPH_FONT_NAME,_

"Verdana", N2PDFVALUE_TOC_HEADER_PARAGRAPH_NAME )

 

 

N2PDFOPTION_TOC_TAB_NUMBER

N2PDFOPTION_TOC_TAB_TEXT

N2PDFOPTION_TOC_TAB_PAGENUMBER

This parameter defines the position of the three columns of the table of contents. The values are the positions of

 

- the numerals, (N2PDFOPTION_TOC_TAB_NUMBER)

- the chapter text and (N2PDFOPTION_TOC_TAB_TEXT)

- the page number (N2PDFOPTION_TOC_TAB_PAGENUMBER)

 

You can use <OptionStr> to pass a value or you set the value to N2PDFVALUE_TOC_AUTOMATIC_TAB in order to automatically calculate the position (default setting). Any value assigned must be given in the units of measurement specified in "System Settings".

 

Example – Set interval to 3 cm:

Call N2PDFSetOption ( JobID, N2PDFOPTION_TOC_Tab_Text, "3" , "" )

 

Example –Set interval to 3 cm but only level 1:

Call N2PDFSetOption ( JobID, N2PDFOPTION_TOC_TAB_TEXT,_

"3" , N2PDFVALUE_TOC_LEVEL1_PARAGRAPH_NAME )

 

112

With this function, the level is quoted as the last parameter (e.g. N2PDFVALUE_TOC_LEVEL1_PARAGRAPH_NAME). If this value is "", then that figure applies to all levels.

 

 

N2PDFOPTION_TOC_TABFILL_NUMBER

N2PDFOPTION_TOC_TABFILL_TEXT

With these two parameters, you can enter a space market between the numbering, the chapter text and the page number. The default value will place blanks there. You may use one of the following values with <OptionString>:

 

Dots

N2PDFVALUE_TOC_TABFILL_DOTS

Vertically centered dots

N2PDFVALUE_TOC_TABFILL_MDOTS

Hyphen

N2PDFVALUE_TOC_TABFILL_HYPHEN

Underscores

N2PDFVALUE_TOC_TABFILL_UNDERLINE

Vertically centered hyphens

N2PDFVALUE_TOC_TABFILL_THYPHEN

Equal signs

N2PDFVALUE_TOC_TABFILL_EQUALSIG

Arrows

N2PDFVALUE_TOC_TABFILL_ARROW

 

Example: Dots between the chapter text and the page number

CallN2PDFSetOption ( JobID, N2PDFOPTION_TOC_TABFILL_TEXT,_

N2PDFVALUE_TOC_TABFILL_DOTS, "" )

 

Example: Points between chapter text and page number only for level 1

CallN2PDFSetOption ( JobID, N2PDFOPTION_TOC_TABFILL_TEXT,_

N2PDFVALUE_TOC_TABFILL_DOTS, N2PDFVALUE_TOC_LEVEL1_PARAGRAPH_NAME )

 

112

With this function, the level is quoted as the last parameter (e.g. N2PDFVALUE_TOC_LEVEL1_PARAGRAPH_NAME). If this value is "", then that figure applies to all levels.

 

 

N2PDFOPTION_TOC_TEXT_MAX_WIDTH

Use this parameter to set the maximum width of the chapter text in the TOC. The entry is in the unit of measure set with N2PDFOPTION_SYSTEM_METRICS_MODE. If this option is activated, the chapter texts can be multiline and the entries are also included in the table of contents in multiple lines.

 

Example: Max. width of 5 cm

Call N2PDFSetOption ( JobID, N2PDFOPTION_TOC_TEXT_MAX_WIDTH, "5", "" )

 

 

 

clip0051

 

 

N2PDFOPTION_TOC_MAX_NUMBERING_LEVEL

The maximum depth of view for the table of contents can be set with this parameter. It is then possible e.g. that only the main chapters (e.g. 1., 2., etc.) appear in the table of contents, even if further sublevels (e.g. 1.1, 1.2 etc.) are present in the main text. The interval between chapter number and text is then adapted automatically once a maximum depth for the Table of Contents has been set.

 

Example: Output only the first-level chapters in the table of contents

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