PrintDocument for WinForms | ComponentOne
C1.PrintDocument.4.8 Assembly / C1.C1Preview Namespace / C1PrintDocument Class / AddAnchor Method / AddAnchor(String,String,Object) Method
A string assigned to the Name of the anchor.
A string assigned to the C1Anchor.Description of the anchor.
Arbitrary data assigned to the C1Anchor.UserData of the anchor.

In This Topic
    AddAnchor(String,String,Object) Method
    In This Topic
    Adds an anchor (C1Anchor or C1AnchorText) at the current position in the document. Can be used only if IsStartEndDocMode is true.
    Syntax
    'Declaration
     
    Public Overloads Sub AddAnchor( _
       ByVal name As String, _
       ByVal description As String, _
       ByVal userData As Object _
    ) 
    public void AddAnchor( 
       string name,
       string description,
       object userData
    )

    Parameters

    name
    A string assigned to the Name of the anchor.
    description
    A string assigned to the C1Anchor.Description of the anchor.
    userData
    Arbitrary data assigned to the C1Anchor.UserData of the anchor.
    Remarks

    This method can only be used if the current document is being created using the StartDoc%M:C1.C1Preview.C1PrintDocument.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 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