To add outline entries to the Outline tab, use the OutlineNodeCollection.Add method.
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() ' Create RenderText1. Dim rt1 As New C1.C1Preview.RenderText rt1.Text = "This is RenderText1." ' Add an outline entry point for RenderText1. Me.C1PrintDocument1.Outlines.Add("RenderText1", rt1) ' Insert a page break. rt1.BreakAfter = C1.C1Preview.BreakEnum.Page ' Create RenderText2. Dim rt2 As New C1.C1Preview.RenderText rt2.Text = "This is RenderText2." ' Add an outline entry point for RenderText2. Me.C1PrintDocument1.Outlines.Add("RenderText2", rt2) ' Add the RenderText to the document. Me.C1PrintDocument1.Body.Children.Add(rt1) Me.C1PrintDocument1.Body.Children.Add(rt2) End Sub |
To write code in C#
C# |
Copy Code
|
---|---|
private void MakeDoc() { // Create RenderText1. C1.C1Preview.RenderText rt1 = new C1.C1Preview.RenderText(); rt1.Text = "This is RenderText1."; // Add an outline entry point for RenderText1. this.c1PrintDocument1.Outlines.Add("RenderText1", rt1); // Add a page break. rt1.BreakAfter = C1.C1Preview.BreakEnum.Page; // Create RenderText2. C1.C1Preview.RenderText rt2 = new C1.C1Preview.RenderText(); rt2.Text = "This is RenderText2."; // Add an outline entry point for RenderText2. this.c1PrintDocument1.Outlines.Add("RenderText2", rt2); // Add the RenderText to the document. this.c1PrintDocument1.Body.Children.Add(rt1); this.c1PrintDocument1.Body.Children.Add(rt2); } |
The outline entries "RenderText1" and "RenderText2" are added to the Outline tab: