[]
        
(Showing Draft Content)

C1.C1Preview.C1PrintDocument.AddAnchor

AddAnchor Method

AddAnchor(string, string, object)

Adds an anchor (C1Anchor or C1AnchorText) at the current position in the document. Can be used only if IsStartEndDocMode is true.

Declaration
public void AddAnchor(string name, string description, object userData)
Parameters
Type Name Description
string name

A string assigned to the Name of the anchor.

string description

A string assigned to the Description of the anchor.

object userData

Arbitrary data assigned to the UserData of the anchor.

Remarks

This method can only be used if the current document is being created using the StartDoc()/EndDoc() methods (i.e. if IsStartEndDocMode is true).

The type of anchor that this method creates depends on the current state of the document:
  • If an inline paragraph has been started (e.g. with a call to RenderInline(ParagraphObject, object, object, Style) or C1.C1Preview.C1PrintDocument.RenderInlineBegin(System.Object,System.Object,C1.C1Preview.Style,System.Boolean)) and has not been ended (e.g. with a call to RenderInlineEnd(), or any of the RenderBlock() or RenderDirect() methods), this method creates a C1AnchorText on the current paragraph.
  • Otherwise (if there's no current inline paragraph), this method creates a C1Anchor at the current point in the block flow.
See Also

AddAnchor(string, string)

Adds an anchor (C1Anchor or C1AnchorText) at the current position in the document. Can be used only if IsStartEndDocMode is true.

This method is equivalent to AddAnchor(string, string, object) with the last parameter (user data) specified as null value.

Declaration
public void AddAnchor(string name, string description)
Parameters
Type Name Description
string name

A string assigned to the Name of the anchor.

string description

A string assigned to the Description of the anchor.

See Also

AddAnchor(string)

Adds an anchor (C1Anchor or C1AnchorText) at the current position in the document. Can be used only if IsStartEndDocMode is true.

This method is equivalent to AddAnchor(string, string, object) with the last two parameters (description and user data) specified as null values.

Declaration
public void AddAnchor(string name)
Parameters
Type Name Description
string name

A string assigned to the Name of the anchor.

See Also