Clears the current document, sets all properties to their default values.

Namespace:  C1.C1Preview
Assembly:  C1.C1Report.2 (in C1.C1Report.2.dll)

Syntax

C#
public void Clear()
Visual Basic
Public Sub Clear

Examples

The following code uses the Clear()()()() method to clear the document settings in the first document and return the settings to the default values:

Copy CodeVisual Basic
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    Dim doc As New C1.C1Preview.C1PrintDocument()
    Dim title As New C1.C1Preview.RenderText("This is just a sample")
    title.Style.TextAlignHorz = C1.C1Preview.AlignHorzEnum.Center
    title.Style.Padding.All = "5mm"
    doc.Body.Children.Add(title)
    doc.Body.Children.Add(doc)
    doc.Clear()
End Sub
Copy CodeC#
private void Form1_Load(object sender, EventArgs e)
{
    C1.C1Preview.C1PrintDocument doc = new C1.C1Preview.C1PrintDocument();
    C1.C1Preview.RenderText title = new C1.C1Preview.RenderText("This is just a sample");
    title.Style.TextAlignHorz = C1.C1Preview.AlignHorzEnum.Center;
    title.Style.Padding.All = "5mm";
    doc.Body.Children.Add(title);
    doc.Body.Children.Add(doc);
    doc.Clear();
}

See Also