skip navigation
  • Product Bundles

    DevCraft

    All Telerik .NET tools and Kendo UI JavaScript components in one package. Now enhanced with:

    • AI Coding Assistants
    • Embedded Reporting
    • Document Processing Libraries
    • SSO Account Sign-in

    Web

    Kendo UI UI for Angular UI for Vue UI for jQuery KendoReact UI for Blazor UI for ASP.NET Core UI for ASP.NET MVC UI for ASP.NET AJAX

    Mobile

    UI for .NET MAUI

    Document Management

    Telerik Document Processing

    Desktop

    UI for .NET MAUI UI for WinUI UI for WinForms UI for WPF

    Reporting

    Telerik Reporting Telerik Report Server

    Testing & Mocking

    Test Studio Telerik JustMock

    CMS

    Sitefinity

    AI Productivity Tools

    AI Coding Assistants

    UI/UX Tools

    ThemeBuilder Design System Kit Templates and Building Blocks

    Debugging

    Fiddler Fiddler Everywhere Fiddler Classic Fiddler Everywhere Reporter FiddlerCore

    Free Tools

    KendoReact Free VB.NET to C# Converter Testing Framework
    View all products
  • Overview
  • Demos
    • What's New
    • Roadmap
    • Release History
  • Support and Learning

    • Support and Learning Hub
    • First Steps
    • Docs
    • Demos
    • Virtual Classroom
    • Forums
    • Videos
    • Blogs
    • Accessibility
    • Submit a Ticket

    Productivity and Design Tools

    • Visual Studio Extensions
    • Visual Studio Templates
    • Embedded Reporting
  • Pricing
  • Shopping cart
    • Account Overview
    • Your Licenses
    • Downloads
    • Support Center
    • Forum Profile
    • Payment Methods
    • Edit Profile
    • Log out
  • Login
  • Contact Us
  • Try now

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
System.Object
RadPrintDocument
Namespace: Telerik.WinControls.UI
Assembly: Telerik.WinControls.UI.dll

Syntax

public class RadPrintDocument : PrintDocument

Constructors

RadPrintDocument()

Initializes a new instance of the RadPrintDocument class.

Declaration
public 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

Gets or sets the font of the page footer.

Declaration
public Font FooterFont { get; set; }
Property Value
System.Drawing.Font

FooterHeight

Gets or sets the height of the footer area in hundredths of an inch.

Declaration
public int FooterHeight { get; set; }
Property Value
System.Int32

An integer representing the footer height.

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

Gets or sets the text that will be printed near the bottom left corner of the page.

Declaration
public string LeftFooter { get; set; }
Property Value
System.String

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

Gets or sets the text that will be printed at the bottom center of the page.

Declaration
public string MiddleFooter { get; set; }
Property Value
System.String

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

Gets or sets a value indicating whether the left and right footer positions should be reversed on even pages.

Declaration
public bool ReverseFooterOnEvenPages { get; set; }
Property Value
System.Boolean

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
public bool ReverseHeaderOnEvenPages { get; set; }
Property Value
System.Boolean

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
public string RightFooter { get; set; }
Property Value
System.String

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)

Determines whether the specified string contains the logo placeholder token.

Declaration
protected bool HasLogoInHeaderFooterString(string s)
Parameters
System.String s

The string to check for the logo placeholder.

Returns
System.Boolean

true if the string contains the logo placeholder; otherwise, false.

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)

Parses a header or footer string by replacing placeholder tokens with their actual values.

Declaration
protected string ParseHeaderFooterString(string s)
Parameters
System.String s

The string containing placeholder tokens to be replaced.

Returns
System.String

The parsed string with placeholders replaced by actual values.

PrintFooter(PrintPageEventArgs)

Prints the footer part of the page.

Declaration
protected virtual void PrintFooter(PrintPageEventArgs args)
Parameters
System.Drawing.Printing.PrintPageEventArgs args

The printing arguments.

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.

Extension Methods

SvgExtentions.Traverse<T>(T, Func<T, IEnumerable<T>>)
SvgExtentions.TraverseDepthFirst<T>(T, Func<T, IEnumerable<T>>)
Getting Started
  • Install Now
  • Demos
  • Step-by-Step Tutorial
  • Sample Applications
  • SDK Samples
  • Visual Studio Extensions
Support Resources
  • Code Library
  • Knowledge Base
  • Videos
Community
  • Forums
  • Blogs
  • Feedback Portal
  • Document Processing Feedback Portal

Copyright © 2018 Progress Software Corporation and/or its subsidiaries or affiliates.
All Rights Reserved.

Progress, Telerik, and certain product names used herein are trademarks or registered trademarks of Progress Software Corporation and/or one of its subsidiaries or affiliates in the U.S. and/or other countries. See Trademarks for appropriate markings.