DynaPDF Manual - Page 142

Previous Page 141   Index   Next Page 143

Function Reference
Page 142 of 839
Page numbering
The page number format has two reserved characters:
0..2147483648 // The number is added to the current page index (the first page is 1).
// 'n' is replaced by the number of pages. The 'n' must be surrounded by a
// delimiter, otherwise it is treated as text.
Delimiters: ' ', ')', '(', '[', ']', '<', '>', '/', '%', '{', '}'.
Arbitrary text can occur before, between, and after a reserved character. Example results on the first
page if the document has 57 pages:
// Ok, 28 is added to the page index.
-> "28"
<< Page 4 of n>>
// Ok.
-> " Page 4 of 57"
// Ok.
-> "1/57"
// Ok, but unusual.
-> "0/57"
<<-5 of n>>
// Ok, note that the minus is treated as text! -> "-5 of 57"
<<Page1 ofn pages>> // Ok, but the 'n' is treated as text.
-> "Page1 ofn pages"
<<Page 5 of n>>
// Ok, 5 is added to the page index.
-> "Page 5 of 57"
<<Seite 1 von n>>
// Ok.
-> "Seite 1 von 57"
// Wrong, nothing to do. Treated as text.
-> "<<Page>>"
Although it is possible to output the page number without surrounding whitespace, the function
saves the format with surrounding whitespace in the XML data to achieve better compatibility to
Adobe Acrobat (except if a format like "1/n" is used).
However, the page numbering tool in Adobe Acrobat is very restricted. Therefore, it is not always
guaranteed that Acrobat is able to load a page numbering format created by this function. Although
if Acrobat will fail to edit a page numbering record, it is usually still possible to delete the header /
footer definition and to add a new one.
Header / footer text
Every header / footer string can contain plain text and one or more format strings as described
above. The maximum output length of a header / footer string is 511 characters.
Header / footer types
The function creates two different header / footer types depending on the contents in it. If a header
or footer string contains a bates number, then the type BatesN is created, otherwise the type Header.
The two different types can be loaded and deleted separately. Header / footer settings can be loaded
with LoadHeaderFooterSettings() and deleted with Optimize(). Optimize() supports the flags
ofRemoveBatesNumbers and ofRemoveHeaderFooter in order to remove headers / footers from a PDF
Return value:
If the function succeeds the return value is 1. If the function fails the return value is 0.

Previous topic: Text color, Bates numbering, Date formats

Next topic: AddImage