Constants

Startseite  Vorherige Seite  Nächste Seite

 

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 can be used in the body field and in headers and footers:

 

[ACTPG]

Current page number

1

[SUMPG]

Number of pages

10

[DATETIME]

Current date and time

11/28/2003 16:21:40

[DATES]

Current date in short form

11/28/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 leading zero

4

[HOURL]

Current hour with leading zero

04

[MINUTES]

Current minute without leading zero

6

[MINUTEL]

Current minute with leading zero

06

[SECONDS]

Current second without leading zero

9

[SECONDL]

Current second with leading zero

09

[CRLF]

Line break        


[NEWPG]

Page break


 

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.