Gets or sets page settings associated with the current document.

IMPORTANT NOTE: The PageSettings object returned by this property is created on the fly, and any changes made to its sub-properties may be lost unless you explicitly assign the modified object to the current property.

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

Syntax

Field Value

A snapshot of the current page settings.

Examples

The following example uses the PageSettings example to set the page settings for the new page:

Copy CodeVisual Basic
Private Sub Form1_Load(ByVal sender As Object, ByVal e As EventArgs) Handles MyBase.Load
    MakeDoc1(C1PrintDocument1)
    C1PrintDocument1.Generate()
End Sub
Private Sub MakeDoc1(ByVal doc As C1.C1Preview.C1PrintDocument)
    doc.Style.Font = New Font("Verdana", 14)
    ' Define PageLayout for the first page.
    Dim pl As C1.C1Preview.PageLayout = New C1.C1Preview.PageLayout
    pl.PageSettings = New C1.C1Preview.C1PageSettings
    pl.PageSettings.PaperKind = System.Drawing.Printing.PaperKind.Legal
    doc.PageLayouts.FirstPage = pl
    ' Generate the content of document.
    Dim ro As C1.C1Preview.RenderText = C1.C1Preview.New RenderText("This is the first page of the document. It has no page header or footer, and has Legal size.")
    doc.Body.Children.Add(ro)
    Const text As String = "This is an example"
    doc.Body.Children.Add(New C1.C1Preview.RenderText(text, C1.C1Preview.AlignHorzEnum.Justify))
End Sub
Copy CodeC#
private void Form1_Load(object sender, EventArgs e)
{
    MakeDoc1(c1PrintDocument1);
    c1PrintDocument1.Generate();
}
private void MakeDoc1(C1.C1Preview.C1PrintDocument doc)
{
    doc.Style.Font = new Font("Verdana", 14);
    // Define PageLayout for the first page.
    C1.C1Preview.PageLayout pl = new C1.C1Preview.PageLayout();
    pl.PageSettings = new C1.C1Preview.C1PageSettings();
    pl.PageSettings.PaperKind = System.Drawing.Printing.PaperKind.Legal;
    doc.PageLayouts.FirstPage = pl;
    // Generate the content of document.
    C1.C1Preview.RenderText ro = new C1.C1Preview.RenderText("This is the first page of the document. It has no page header or footer, and has Legal size.");
    doc.Body.Children.Add(ro);
    const string text = "This is an example";
    doc.Body.Children.Add(new C1.C1Preview.RenderText(text, C1.C1Preview.AlignHorzEnum.Justify));
}

See Also