Class TreeViewPrintDocument
Represents the custom printing support for TreeViewAdv.
Inheritance
Namespace: Syncfusion.Windows.Forms.Tools
Assembly: Syncfusion.Tools.Windows.dll
Syntax
public class TreeViewPrintDocument : PrintDocument
Examples
Use the following code for printing:
TreeViewPrintDocument printDocument = new TreeViewPrintDocument(this.treeViewAdv1);
printDocument.Print();
Use the following code for print preview:
TreeViewPrintDocument printDocument = new TreeViewPrintDocument(this.treeViewAdv1);
printDocument.PrintPreview();
Constructors
TreeViewPrintDocument(TreeViewAdv)
Initialize a new instance of the TreeViewPrintDocument class.
Declaration
public TreeViewPrintDocument(TreeViewAdv tree)
Parameters
| Type | Name | Description |
|---|---|---|
| TreeViewAdv | tree | The instance of the TreeViewAdv. |
Properties
EnableCustomFooter
Gets or sets the value indicates whether Custom Footer is enabled or not.
Declaration
public bool EnableCustomFooter { get; set; }
Property Value
| Type |
|---|
| System.Boolean |
EnableCustomHeader
Gets or sets the value indicates whether Custom Header is enabled or not.
Declaration
public bool EnableCustomHeader { get; set; }
Property Value
| Type |
|---|
| System.Boolean |
FooterAlignment
Gets or sets the value of the Footer Alignment.
Declaration
public TextAlignment FooterAlignment { get; set; }
Property Value
| Type |
|---|
| TextAlignment |
FooterFont
Gets or sets the value of the Footer font.
Declaration
public Font FooterFont { get; set; }
Property Value
| Type |
|---|
| System.Drawing.Font |
FooterHeight
Gets or sets a value that specifies the height of the footer.
Declaration
public int FooterHeight { get; set; }
Property Value
| Type |
|---|
| System.Int32 |
FooterText
Gets or sets the value of the Footer text.
Declaration
public string FooterText { get; set; }
Property Value
| Type |
|---|
| System.String |
FooterTextColor
Gets or sets the value of the Footer text color.
Declaration
public Color FooterTextColor { get; set; }
Property Value
| Type |
|---|
| System.Drawing.Color |
HeaderAlignment
Gets or sets the value of the HeaderAlignment.
Declaration
public TextAlignment HeaderAlignment { get; set; }
Property Value
| Type |
|---|
| TextAlignment |
HeaderFont
Gets or sets the value of the Header font.
Declaration
public Font HeaderFont { get; set; }
Property Value
| Type |
|---|
| System.Drawing.Font |
HeaderHeight
Gets or sets a value that specifies the height of the header.
Declaration
public int HeaderHeight { get; set; }
Property Value
| Type |
|---|
| System.Int32 |
HeaderText
Gets or sets the value of the Header text.
Declaration
public string HeaderText { get; set; }
Property Value
| Type |
|---|
| System.String |
HeaderTextColor
Gets or sets the value of the Header text color.
Declaration
public Color HeaderTextColor { get; set; }
Property Value
| Type |
|---|
| System.Drawing.Color |
PrintHeaderFooterOnAllPages
Gets or sets the value indicates whether the Header and Footer shown on all the pages.
Declaration
public bool PrintHeaderFooterOnAllPages { get; set; }
Property Value
| Type |
|---|
| System.Boolean |
Remarks
If PrintHeaderOnFirstPageOnly is enabled, then Header will shown on first page only.
PrintHeaderOnFirstPageOnly
Gets or sets the value indicates whether the Header is shown on first page only.
Declaration
public bool PrintHeaderOnFirstPageOnly { get; set; }
Property Value
| Type |
|---|
| System.Boolean |
ShowDateTime
Gets or sets the value indicates whether the date time is shown or not.
Declaration
public bool ShowDateTime { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Boolean | true, if the DateTime is showed in printing process. Otherwise, false. The default value is false. |
ShowPageNumber
Gets or sets the value indicates whether the page number is shown or not.
Declaration
public bool ShowPageNumber { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Boolean | true, if the Page number is showed in printing process. Otherwise, false. The default value is true. |
Methods
OnBeginPrint(PrintEventArgs)
Raises the BeginPrint event. It is called after the Print() method is called and before the first page of the control prints.
Declaration
protected override void OnBeginPrint(PrintEventArgs e)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Drawing.Printing.PrintEventArgs | e | The PrintEventArgs contains the event data. |
OnPrintFooter(TreeViewPrintHeaderFooterEventArgs)
Raises the DrawPrintFooter event
Declaration
protected virtual void OnPrintFooter(TreeViewPrintHeaderFooterEventArgs e)
Parameters
| Type | Name | Description |
|---|---|---|
| TreeViewPrintHeaderFooterEventArgs | e | A TreeViewPrintHeaderFooterEventArgsthat contains the event data |
OnPrintHeader(TreeViewPrintHeaderFooterEventArgs)
Raises the DrawPrintHeader event
Declaration
protected virtual void OnPrintHeader(TreeViewPrintHeaderFooterEventArgs e)
Parameters
| Type | Name | Description |
|---|---|---|
| TreeViewPrintHeaderFooterEventArgs | e | A TreeViewPrintHeaderFooterEventArgsthat contains the event data |
OnPrintPage(PrintPageEventArgs)
Raises the PrintPage event. It is called before a control prints.
Declaration
protected override void OnPrintPage(PrintPageEventArgs e)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Drawing.Printing.PrintPageEventArgs | e | The PrintPageEventArgs contains the event data. |
PrepareTreeImage(TreeViewAdv)
Gets an image that shows the entire tree, not just what is visible on the form.
Declaration
public void PrepareTreeImage(TreeViewAdv tree)
Parameters
| Type | Name | Description |
|---|---|---|
| TreeViewAdv | tree | The instance of the TreeViewAdv. |
Print()
Represents the printing process of the TreeViewAdv.
Declaration
public void Print()
Print(TreeViewAdv)
Represents the printing process of the TreeViewAdv.
Declaration
public void Print(TreeViewAdv treeView)
Parameters
| Type | Name | Description |
|---|---|---|
| TreeViewAdv | treeView | The TreeViewAdv which needs to be printed. |
PrintNoDialog()
Prints entire control directly on default printer.
Declaration
public void PrintNoDialog()
PrintPreview()
Begins the printing process of the TreeViewAdv and it shows TreeViewAdv before printing.
Declaration
public void PrintPreview()
PrintPreview(TreeViewAdv)
Shows a PrintPreview dialog displaying the Tree control passed in.
Declaration
public void PrintPreview(TreeViewAdv treeView)
Parameters
| Type | Name | Description |
|---|---|---|
| TreeViewAdv | treeView | The TreeView instance for print preview. |
Events
DrawPrintFooter
Handle the event to draw Footer to the TreeViewAdv print document.
Declaration
public event TreeViewPrintDocument.DrawPrintHeaderFooterEventHandler DrawPrintFooter
Event Type
| Type |
|---|
| TreeViewPrintDocument.DrawPrintHeaderFooterEventHandler |
DrawPrintHeader
Handle the event to draw Header to the TreeViewAdv print document.
Declaration
public event TreeViewPrintDocument.DrawPrintHeaderFooterEventHandler DrawPrintHeader
Event Type
| Type |
|---|
| TreeViewPrintDocument.DrawPrintHeaderFooterEventHandler |