Class RadPrintDocument
Defines a reusable object that sends output to a printer and manages the whole printing process, when printing from an application. Can be associated with any object that implements the IPrintable interface.
Inheritance
Namespace: Telerik.WinControls.UI
Assembly: Telerik.WinControls.UI.dll
Syntax
public class RadPrintDocument : PrintDocument
Constructors
RadPrintDocument()
Fields
DatePrintedString
Declaration
public const string DatePrintedString = "[Date Printed]"
Field Value
System.String
|
LogoString
Declaration
public const string LogoString = "[Logo]"
Field Value
System.String
|
PageNumberString
Declaration
public const string PageNumberString = "[Page #]"
Field Value
System.String
|
TimePrintedString
Declaration
public const string TimePrintedString = "[Time Printed]"
Field Value
System.String
|
TotalPagesString
Declaration
public const string TotalPagesString = "[Total Pages]"
Field Value
System.String
|
UserNamePrintedString
Declaration
public const string UserNamePrintedString = "[User Name]"
Field Value
System.String
|
Properties
AssociatedObject
Gets or sets the IPrintable object associated with this document for printing.
Declaration
public IPrintable AssociatedObject { get; set; }
Property Value
IPrintable
An object that implements IPrintable, or null if no object is associated. |
AutoPortraitLandscape
Gets or sets a value indicating whether the orientation should be automatically determined based on the content.
Declaration
public bool AutoPortraitLandscape { get; set; }
Property Value
System.Boolean
true to automatically choose between portrait and landscape; otherwise, false. |
CurrentPage
Gets or sets the currently selected page. This page will be the first to be printed when the PrintRange is set to Current or Selection.
Declaration
public int CurrentPage { get; set; }
Property Value
System.Int32
|
FooterFont
FooterHeight
HeaderFont
Gets or sets the font of the page header.
Declaration
public Font HeaderFont { get; set; }
Property Value
System.Drawing.Font
|
HeaderHeight
Gets or sets the height of the header area.
Declaration
public int HeaderHeight { get; set; }
Property Value
System.Int32
|
IsPrinting
Indicates whether the printing process is running.
Declaration
public bool IsPrinting { get; }
Property Value
System.Boolean
|
Landscape
Gets or sets a value indicating whether the document should be printed in landscape orientation.
Declaration
public bool Landscape { get; set; }
Property Value
System.Boolean
true to print in landscape orientation; otherwise, false for portrait orientation. |
LeftFooter
LeftHeader
Gets or sets the text that will be printed near the upper left corner of the page.
Declaration
public string LeftHeader { get; set; }
Property Value
System.String
|
Logo
Gets or sets the logo image that will be printed when the [Logo] placeholder is used in headers or footers.
Declaration
public Image Logo { get; set; }
Property Value
System.Drawing.Image
An System.Drawing.Image representing the logo, or null if no logo is set. |
Margins
Gets or sets the margins for the printed page.
Declaration
public Margins Margins { get; set; }
Property Value
System.Drawing.Printing.Margins
A System.Drawing.Printing.Margins object that represents the page margins, or null to use the default. |
MiddleFooter
MiddleHeader
Gets or sets the text that will be printed at the top center of the page.
Declaration
public string MiddleHeader { get; set; }
Property Value
System.String
|
PageCount
Gets the total page count. The value is populated when the printing process begins.
Declaration
public int PageCount { get; }
Property Value
System.Int32
|
PaperSize
Gets or sets the paper size for printing.
Declaration
public PaperSize PaperSize { get; set; }
Property Value
System.Drawing.Printing.PaperSize
A System.Drawing.Printing.PaperSize object that represents the size of the paper, or null to use the default. |
PaperSource
Gets or sets the paper source (tray) from which to get the paper.
Declaration
public PaperSource PaperSource { get; set; }
Property Value
System.Drawing.Printing.PaperSource
A System.Drawing.Printing.PaperSource object that represents the paper source, or null to use the default. |
PrintedPage
Gets the number of the page being printed. The value of this property changes during the printing process.
Declaration
public int PrintedPage { get; }
Property Value
System.Int32
|
ReverseFooterOnEvenPages
ReverseHeaderOnEvenPages
Gets or sets a value indicating whether the left and right header positions should be reversed on even pages.
Declaration
public bool ReverseHeaderOnEvenPages { get; set; }
Property Value
System.Boolean
true to reverse the header positions on even pages; otherwise, false. |
RightFooter
RightHeader
Gets or sets the text that will be printed near the upper right corner of the page.
Declaration
public string RightHeader { get; set; }
Property Value
System.String
|
SelectionLength
Gets or sets the count of the selected pages. This indicates how many pages will be printed when the PrintRange is set to Selection.
Declaration
public int SelectionLength { get; set; }
Property Value
System.Int32
|
Watermark
Gets or sets the watermark settings for the printed pages.
Declaration
public RadPrintWatermark Watermark { get; set; }
Property Value
RadPrintWatermark
A RadPrintWatermark object that defines the watermark properties, or null if no watermark is used. |
Methods
HasLogoInHeaderFooterString(String)
OnAssociatedObjectChanged()
Called when the associated printable object has changed.
Declaration
protected virtual void OnAssociatedObjectChanged()
OnBeginPrint(PrintEventArgs)
Handles the beginning of the print job by initializing the page count and setting up print parameters.
Declaration
protected override void OnBeginPrint(PrintEventArgs e)
Parameters
System.Drawing.Printing.PrintEventArgs
e
A System.Drawing.Printing.PrintEventArgs that contains the event data. |
OnEndPrint(PrintEventArgs)
Handles the end of the print job by finalizing the printing process and cleaning up resources.
Declaration
protected override void OnEndPrint(PrintEventArgs e)
Parameters
System.Drawing.Printing.PrintEventArgs
e
A System.Drawing.Printing.PrintEventArgs that contains the event data. |
OnPrintPage(PrintPageEventArgs)
Handles the printing of each page by coordinating the watermark, content, header, and footer rendering.
Declaration
protected override void OnPrintPage(PrintPageEventArgs e)
Parameters
System.Drawing.Printing.PrintPageEventArgs
e
A System.Drawing.Printing.PrintPageEventArgs that contains the event data. |
ParseHeaderFooterString(String)
PrintFooter(PrintPageEventArgs)
PrintHeader(PrintPageEventArgs)
Prints the header part of the page.
Declaration
protected virtual void PrintHeader(PrintPageEventArgs args)
Parameters
System.Drawing.Printing.PrintPageEventArgs
args
The printing arguments. |
PrintLogo(Graphics, Rectangle)
Renders the logo image within the specified rectangle.
Declaration
protected virtual void PrintLogo(Graphics g, Rectangle rect)
Parameters
System.Drawing.Graphics
g
The System.Drawing.Graphics object to draw on. |
System.Drawing.Rectangle
rect
The System.Drawing.Rectangle area where the logo should be drawn. |
PrintWatermark(PrintPageEventArgs)
Prints the watermark of the page.
Declaration
protected virtual void PrintWatermark(PrintPageEventArgs args)
Parameters
System.Drawing.Printing.PrintPageEventArgs
args
The printing arguments. |