To set the page size for the document, use the PaperKind property.
To write code in Visual Basic
Visual Basic |
Copy Code
|
---|---|
' Make the document. MakeDoc() ' Generate the document. Me.C1PrintDocument1.Generate() |
To write code in C#
C# |
Copy Code
|
---|---|
// Make the document. MakeDoc(); // Generate the document. this.c1PrintDocument1.Generate(); |
To write code in Visual Basic
Visual Basic |
Copy Code
|
---|---|
Private Sub MakeDoc() ' Define the page layout for the document. Dim pl As New C1.C1Preview.PageLayout() pl.PageSettings = New C1.C1Preview.C1PageSettings() pl.PageSettings.PaperKind = System.Drawing.Printing.PaperKind.Legal Me.C1PrintDocument1.PageLayouts.Default = pl End Sub |
To write code in C#
C# |
Copy Code
|
---|---|
private void MakeDoc() { // Define the page layout for the document. C1.C1Preview.PageLayout pl = new C1.C1Preview.PageLayout(); pl.PageSettings = new C1.C1Preview.C1PageSettings(); pl.PageSettings.PaperKind = System.Drawing.Printing.PaperKind.Legal; this.c1PrintDocument1.PageLayouts.Default = pl; } |
The default page size is set to Legal: