AsposeWordsPrintDocument Class

Provides a default implementation for printing of a Document within the .NET printing framework.

ExpandedInheritance Hierarchy

Namespace:  Aspose.Words.Rendering
Assembly:  Aspose.Words (in Aspose.Words.dll) Version: 21.5.0

ExpandedSyntax

public class AsposeWordsPrintDocument : PrintDocument

The AsposeWordsPrintDocument type exposes the following members.

ExpandedConstructors

  NameDescription
Public methodCode exampleAsposeWordsPrintDocument
Initializes a new instance of this class.

ExpandedProperties

  NameDescription
Public propertyContainer
Gets the IContainer that contains the Component.
(Inherited from Component.)
Public propertyDefaultPageSettings
Gets or sets page settings that are used as defaults for all pages to be printed.
(Inherited from PrintDocument.)
Public propertyDocumentName
Gets or sets the document name to display (for example, in a print status dialog box or printer queue) while printing the document.
(Inherited from PrintDocument.)
Public propertyOriginAtMargins
Gets or sets a value indicating whether the position of a graphics object associated with a page is located just inside the user-specified margins or at the top-left corner of the printable area of the page.
(Inherited from PrintDocument.)
Public propertyPrintController
Gets or sets the print controller that guides the printing process.
(Inherited from PrintDocument.)
Public propertyPrinterSettings
Gets or sets the printer that prints the document.
(Inherited from PrintDocument.)
Public propertySite
Gets or sets the ISite of the Component.
(Inherited from Component.)

ExpandedMethods

  NameDescription
Public methodCode exampleCachePrinterSettings
Reads and caches some fields of PrinterSettings to reduce printing time.
Public methodCreateObjRef
Creates an object that contains all the relevant information required to generate a proxy used to communicate with a remote object.
(Inherited from MarshalByRefObject.)
Public methodDispose
Releases all resources used by the Component.
(Inherited from Component.)
Public methodEquals
Determines whether the specified object is equal to the current object.
(Inherited from Object.)
Public methodGetHashCode
Serves as the default hash function.
(Inherited from Object.)
Public methodGetLifetimeService
Retrieves the current lifetime service object that controls the lifetime policy for this instance.
(Inherited from MarshalByRefObject.)
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Public methodInitializeLifetimeService
Obtains a lifetime service object to control the lifetime policy for this instance.
(Inherited from MarshalByRefObject.)
Public methodPrint
Starts the document's printing process.
(Inherited from PrintDocument.)
Public methodToString
Provides information about the print document, in string form.
(Inherited from PrintDocument.)

ExpandedEvents

  NameDescription
Public eventBeginPrint
Occurs when the Print method is called and before the first page of the document prints.
(Inherited from PrintDocument.)
Public eventDisposed
Occurs when the component is disposed by a call to the Dispose method.
(Inherited from Component.)
Public eventEndPrint
Occurs when the last page of the document has printed.
(Inherited from PrintDocument.)
Public eventPrintPage
Occurs when the output to print for the current page is needed.
(Inherited from PrintDocument.)
Public eventQueryPageSettings
Occurs immediately before each PrintPage event.
(Inherited from PrintDocument.)

ExpandedRemarks

AsposeWordsPrintDocument overrides OnBeginPrint(PrintEventArgs) to print the range of pages that is specified in PrinterSettings.

A single Word document can consist of multiple sections that specify pages with different sizes, orientation and paper trays. AsposeWordsPrintDocument overrides OnQueryPageSettings(QueryPageSettingsEventArgs) to properly select paper size, orientation and paper source when printing a Word document.

Microsoft Word stores printer specific values for paper trays in a Word document and therefore, only printing on the same printer model as the one that was selected when the user specified the paper trays will result in printing from the correct trays. If you print a document on a different printer, then most likely the default paper tray will be used, not the trays specified in the document.

ExpandedSee Also