PdfParam Object


PdfParam is a special object encapsulating a series of named numeric and Boolean parameters. It is a collection of PdfParamItem objects representing individual named parameters. It is via the PdfParam object that many AspPDF properties and methods receive their parameters. PdfParam is creatable via PdfManager's CreateParam method. For more information about the PdfParam object, see Section 2.3 - PdfParam Object.

Member List


Count As Long (Read-only)
Returns the number of PdfParamItem objects in this collection.

Item As (Name As String) As PdfParamItem (Read-only)

Returns a parameter item specified by Name. If the specified name is not found, a new parameter item is created, assigned the specified Name, initialized to 0 and returned. This is the default property.


Param.Item("Alignment") = 2


Param("Alignment") = 2 (VB Script)

Param["Alignment"].Value = 2(C#)


Sub Add(ParamString As String)

Adds one or more parameters specified by ParamString to this PdfParam object. A parameter string contains a list of comma- or semicolon-separated Name=Value expressions. Spaces and case of characters are ignored. The order in which items are listed is immaterial.

The Value part of an expression may be an integer or fixed-point float value. Integers may be presented in decimal or hexadecimal formats. Hexadecimal numbers are prefixed with a &H or #. A Value may also be one of the pre-defined constants such as blue (and other colors), true, false, and other values specific to a particular method or property.

If a parameter with the same name already exists in the PdfParam object, it is overwritten with the new value specified in the parameter string.

Examples (all produce the same result):

Param.Add "x=10; y=20; alignment=right; color=blue"

Param.Add "Alignment=1;X=10,Y=20;color=&H0000FF"

Param.Add "color=#0000FF;Alignment=Right, X=10, Y=20"

Sub Clear()
Clears the collection of all parameter items.

Function IsSet(Name As String) As Boolean
Returns True if a parameter item specified by Name is present in the collection.

Sub Remove(Name As String)
Removes a parameter item specified by Name from the collection.

Sub Set(ParamString As String)

Same as the Add method, but clears the collection before adding new items. Therefore, a call

Param.Set "parameter string"
is equivalent to
Param.Add "parameter string"