ExpandVariableTokens

Page layout

Description

Expands case-insensitive <%name%> placeholders for a page

The built-in names are PageNo, TotalPages, ShortDate, LongDate, ShortTime and LongTime; other names are passed to OnCalcVariable, or preserved verbatim when no handler is assigned

ExpandStampTokens calls this method automatically after expanding the classic ampersand tokens

Syntax

Delphi

Function TPDFlib.ExpandVariableTokens(Const Text: WideString; PageNo, TotalPages: Integer): WideString;

Parameters

TextText containing zero or more variable placeholders
PageNoOne-based current page number
TotalPagesTotal page count used by the built-in placeholder

Return values

Text with all recognised placeholders expanded