ClassRadPrintDocument
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.
Definition
Namespace:Telerik.WinControls.UI
Assembly:Telerik.WinControls.UI.dll
Syntax:
public class RadPrintDocument : PrintDocument, IComponent, IDisposable
Inheritance: objectMarshalByRefObjectComponentPrintDocumentRadPrintDocument
Implements:
Inherited Members
Constructors
RadPrintDocument()
Initializes a new instance of the RadPrintDocument class.
Declaration
public RadPrintDocument()
Fields
DatePrintedString
Declaration
public const string DatePrintedString = "[Date Printed]"
Field Value
TimePrintedString
Declaration
public const string TimePrintedString = "[Time Printed]"
Field Value
TotalPagesString
Declaration
public const string TotalPagesString = "[Total Pages]"
Field Value
UserNamePrintedString
Declaration
public const string UserNamePrintedString = "[User Name]"
Field Value
Properties
AssociatedObject
Gets or sets the IPrintable object associated with this document for printing.
Declaration
[Browsable(true)]
public IPrintable AssociatedObject { get; set; }
Property Value
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
[Browsable(true)]
public bool AutoPortraitLandscape { get; set; }
Property Value
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
[Browsable(false)]
public int CurrentPage { get; set; }
Property Value
FooterFont
Gets or sets the font of the page footer.
Declaration
[Browsable(true)]
public Font FooterFont { get; set; }
Property Value
FooterHeight
Gets or sets the height of the footer area in hundredths of an inch.
Declaration
[Browsable(true)]
public int FooterHeight { get; set; }
Property Value
An integer representing the footer height.
HeaderFont
Gets or sets the font of the page header.
Declaration
[Browsable(true)]
public Font HeaderFont { get; set; }
Property Value
HeaderHeight
Gets or sets the height of the header area.
Declaration
[Browsable(true)]
public int HeaderHeight { get; set; }
Property Value
IsPrinting
Indicates whether the printing process is running.
Declaration
[Browsable(false)]
public bool IsPrinting { get; }
Property Value
Landscape
Gets or sets a value indicating whether the document should be printed in landscape orientation.
Declaration
[Browsable(true)]
public bool Landscape { get; set; }
Property Value
true to print in landscape orientation; otherwise, false for portrait orientation.
LeftFooter
Gets or sets the text that will be printed near the bottom left corner of the page.
Declaration
[Browsable(true)]
public string LeftFooter { get; set; }
Property Value
LeftHeader
Gets or sets the text that will be printed near the upper left corner of the page.
Declaration
[Browsable(true)]
public string LeftHeader { get; set; }
Property Value
Logo
Gets or sets the logo image that will be printed when the [Logo] placeholder is used in headers or footers.
Margins
Gets or sets the margins for the printed page.
MiddleFooter
Gets or sets the text that will be printed at the bottom center of the page.
Declaration
[Browsable(true)]
public string MiddleFooter { get; set; }
Property Value
MiddleHeader
Gets or sets the text that will be printed at the top center of the page.
Declaration
[Browsable(true)]
public string MiddleHeader { get; set; }
Property Value
PageCount
Gets the total page count. The value is populated when the printing process begins.
PaperSize
Gets or sets the paper size for printing.
PaperSource
Gets or sets the paper source (tray) from which to get the paper.
Declaration
[Browsable(true)]
public PaperSource PaperSource { get; set; }
Property Value
A 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.
ReverseFooterOnEvenPages
Gets or sets a value indicating whether the left and right footer positions should be reversed on even pages.
Declaration
[Browsable(true)]
public bool ReverseFooterOnEvenPages { get; set; }
Property Value
true to reverse the footer positions on even pages; otherwise, false.
ReverseHeaderOnEvenPages
Gets or sets a value indicating whether the left and right header positions should be reversed on even pages.
Declaration
[Browsable(true)]
public bool ReverseHeaderOnEvenPages { get; set; }
Property Value
true to reverse the header positions on even pages; otherwise, false.
RightFooter
Gets or sets the text that will be printed near the bottom right corner of the page.
Declaration
[Browsable(true)]
public string RightFooter { get; set; }
Property Value
RightHeader
Gets or sets the text that will be printed near the upper right corner of the page.
Declaration
[Browsable(true)]
public string RightHeader { get; set; }
Property Value
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
[Browsable(false)]
public int SelectionLength { get; set; }
Property Value
Watermark
Gets or sets the watermark settings for the printed pages.
Declaration
[Browsable(true)]
public RadPrintWatermark Watermark { get; set; }
Property Value
A RadPrintWatermark object that defines the watermark properties, or null if no watermark is used.
Methods
HasLogoInHeaderFooterString(string)
Determines whether the specified string contains the logo placeholder token.
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
e
A PrintEventArgs that contains the event data.
Overrides
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
e
A PrintEventArgs that contains the event data.
Overrides
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
e
A PrintPageEventArgs that contains the event data.
Overrides
ParseHeaderFooterString(string)
Parses a header or footer string by replacing placeholder tokens with their actual values.
PrintFooter(PrintPageEventArgs)
Prints the footer part of the page.
Declaration
protected virtual void PrintFooter(PrintPageEventArgs args)
Parameters
args
The printing arguments.
PrintHeader(PrintPageEventArgs)
Prints the header part of the page.
Declaration
protected virtual void PrintHeader(PrintPageEventArgs args)
Parameters
args
The printing arguments.
PrintLogo(Graphics, Rectangle)
Renders the logo image within the specified rectangle.
PrintWatermark(PrintPageEventArgs)
Prints the watermark of the page.
Declaration
protected virtual void PrintWatermark(PrintPageEventArgs args)
Parameters
args
The printing arguments.