Constants

Start page  Previous page  Next page

 

Constants are a special type of variable, and are based on the same working principle. The difference is that they have permanent names and their content is automatically computed by n2pdf, which means it cannot be set from outside. Constants are inserted where placeholders are found in the PDF.

 

Example for a constant in a RichText field

Page [ACTPG] of [SUMPG]

 

112

You cannot use any names for variables that are already assigned to constants.

 

The following constants (with default delimiters -> see "System Settings") can be used in the main text and in the headers and footers:

 

[ACTPG]

Current page number

1

[SUMPG]

Number of pages

10

[DATETIME]

Current date and time

28.11.2003 16:21:40

[DATES]

Current date in short form

28.11.2003

[DATEL]

Current date in long form

Friday, 28 November 2003

[TIMES]

Current time in short form

16:21

[TIMEL]

Current time in long form

16:21:40

[DAYS]

Current day without preceding zero

5

[DAYL]

Current day with preceding zero

05

[DAYNAMES]

Current day name in short form

Fr

[DAYNAMEL]

Current day name in long form

Friday

[MONTHS]

Current month without preceding zero

5

[MONTHL]

Current month with preceding zero

05

[MONTHNAMES]

Current month name in short form

Nov

[MONTHNAMEL]

Current month name in long form

November

[YEARS]

Current two-digit year

03

[YEARL]

Current four-digit year

2003

[CWS]

Current calendar week without preceding zero

8

[CWL]

Current calendar week with preceding zero

08

[HOURS]

Current hour without preceding zero

4

[HOURL]

Current hour with preceding zero

04

[MINUTES]

Current minute without preceding zero

6

[MINUTEL]

Current minute with preceding zero

06

[SECONDS]

Current second without preceding zero

9

[SECONDL]

Current second with preceding zero

09

[CRLF]

Line break        


[NEWPG]

Page break


[TOC]

Current chapter heading

(can only be inserted in headers and footers)


 

112

Please keep in mind that some values for the constants depend on the system's regional settings, which means that in certain circumstances they may produce different results.