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.
Definition
Namespace:Telerik.WinControls.UI
Assembly:Telerik.WinControls.UI.dll
Syntax:
public class RadPrintDocument : PrintDocument, IComponent, IDisposable
Inheritance: objectMarshalByRefObjectComponentPrintDocumentRadPrintDocument
Implements:
Inherited Members
Constructors
Initializes a new instance of the RadPrintDocument class.
public RadPrintDocument()
Fields
public const string DatePrintedString = "[Date Printed]"
public const string LogoString = "[Logo]"
public const string PageNumberString = "[Page #]"
public const string TimePrintedString = "[Time Printed]"
public const string TotalPagesString = "[Total Pages]"
public const string UserNamePrintedString = "[User Name]"
Properties
Gets or sets the IPrintable object associated with this document for printing.
[Browsable(true)]
public IPrintable AssociatedObject { get; set; }
An object that implements IPrintable, or null if no object is associated.
Gets or sets a value indicating whether the orientation should be automatically determined based on the content.
[Browsable(true)]
public bool AutoPortraitLandscape { get; set; }
true to automatically choose between portrait and landscape; otherwise, false.
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.
[Browsable(false)]
public int CurrentPage { get; set; }
Gets or sets the font of the page footer.
[Browsable(true)]
public Font FooterFont { get; set; }
Gets or sets the height of the footer area in hundredths of an inch.
[Browsable(true)]
public int FooterHeight { get; set; }
An integer representing the footer height.
Gets or sets the font of the page header.
[Browsable(true)]
public Font HeaderFont { get; set; }
Gets or sets the height of the header area.
[Browsable(true)]
public int HeaderHeight { get; set; }
Indicates whether the printing process is running.
[Browsable(false)]
public bool IsPrinting { get; }
Gets or sets a value indicating whether the document should be printed in landscape orientation.
[Browsable(true)]
public bool Landscape { get; set; }
true to print in landscape orientation; otherwise, false for portrait orientation.
Gets or sets the text that will be printed near the bottom left corner of the page.
[Browsable(true)]
public string LeftFooter { get; set; }
Gets or sets the text that will be printed near the upper left corner of the page.
[Browsable(true)]
public string LeftHeader { get; set; }
Gets or sets the logo image that will be printed when the [Logo] placeholder is used in headers or footers.
[Browsable(true)]
public Image Logo { get; set; }
An Image representing the logo, or null if no logo is set.
Gets or sets the margins for the printed page.
[Browsable(true)]
public Margins Margins { get; set; }
A Margins object that represents the page margins, or null to use the default.
Gets or sets the text that will be printed at the bottom center of the page.
[Browsable(true)]
public string MiddleFooter { get; set; }
Gets or sets the text that will be printed at the top center of the page.
[Browsable(true)]
public string MiddleHeader { get; set; }
Gets the total page count. The value is populated when the printing process begins.
[Browsable(false)]
public int PageCount { get; }
Gets or sets the paper size for printing.
[Browsable(true)]
public PaperSize PaperSize { get; set; }
A PaperSize object that represents the size of the paper, or null to use the default.
Gets or sets the paper source (tray) from which to get the paper.
[Browsable(true)]
public PaperSource PaperSource { get; set; }
A PaperSource object that represents the paper source, or null to use the default.
Gets the number of the page being printed. The value of this property changes during the printing process.
[Browsable(false)]
public int PrintedPage { get; }
Gets or sets a value indicating whether the left and right footer positions should be reversed on even pages.
[Browsable(true)]
public bool ReverseFooterOnEvenPages { get; set; }
true to reverse the footer positions on even pages; otherwise, false.
Gets or sets a value indicating whether the left and right header positions should be reversed on even pages.
[Browsable(true)]
public bool ReverseHeaderOnEvenPages { get; set; }
true to reverse the header positions on even pages; otherwise, false.
Gets or sets the text that will be printed near the bottom right corner of the page.
[Browsable(true)]
public string RightFooter { get; set; }
Gets or sets the text that will be printed near the upper right corner of the page.
[Browsable(true)]
public string RightHeader { get; set; }
Gets or sets the count of the selected pages. This indicates how many pages will be printed when the PrintRange is set to Selection.
[Browsable(false)]
public int SelectionLength { get; set; }
Gets or sets the watermark settings for the printed pages.
[Browsable(true)]
public RadPrintWatermark Watermark { get; set; }
A RadPrintWatermark object that defines the watermark properties, or null if no watermark is used.
Methods
Called when the associated printable object has changed.
protected virtual void OnAssociatedObjectChanged()
Handles the beginning of the print job by initializing the page count and setting up print parameters.
protected override void OnBeginPrint(PrintEventArgs e)
A PrintEventArgs that contains the event data.
Overrides:
Handles the end of the print job by finalizing the printing process and cleaning up resources.
protected override void OnEndPrint(PrintEventArgs e)
A PrintEventArgs that contains the event data.
Overrides:
Handles the printing of each page by coordinating the watermark, content, header, and footer rendering.
protected override void OnPrintPage(PrintPageEventArgs e)
A PrintPageEventArgs that contains the event data.
Overrides:
Prints the footer part of the page.
protected virtual void PrintFooter(PrintPageEventArgs args)
The printing arguments.
Prints the header part of the page.
protected virtual void PrintHeader(PrintPageEventArgs args)
The printing arguments.
Prints the watermark of the page.
protected virtual void PrintWatermark(PrintPageEventArgs args)
The printing arguments.