C# Class Aspose.Diagram.Examples.CSharp.Working_with_Print.XpsPrintHelper

A utility class that converts a document to XPS using Aspose.Diagram and then sends to the XpsPrint API.
Show file Open project: aspose-diagram/Aspose.Diagram-for-.NET Class Usage Examples

Public Methods

Method Description
Print ( Diagram diagram, string printerName, string jobName, bool isWait ) : void

Sends an Aspose.Diagram document to a printer using the XpsPrint API.

Print ( Stream stream, string printerName, string jobName, bool isWait ) : void

Sends a stream that contains a document in the XPS format to a printer using the XpsPrint API. Has no dependency on Aspose.Diagram, can be used in any project.

Private Methods

Method Description
CheckJobStatus ( IXpsPrintJob job ) : void
CloseHandle ( IntPtr hObject ) : bool
CopyJob ( Stream stream, IXpsPrintJob job, IXpsPrintJobStream jobStream ) : void
CreateEvent ( IntPtr lpEventAttributes, bool bManualReset, bool bInitialState, string lpName ) : IntPtr
StartJob ( string printerName, string jobName, IntPtr completionEvent, IXpsPrintJob &job, IXpsPrintJobStream &jobStream ) : void
StartXpsPrintJob ( [ printerName, [ jobName, [ outputFileName, IntPtr progressEvent, IntPtr completionEvent, [ printablePagesOn, UInt32 printablePagesOnCount, IXpsPrintJob &xpsPrintJob, IXpsPrintJobStream &documentStream, IntPtr printTicketStream ) : int
WaitForJob ( IntPtr completionEvent ) : void
WaitForSingleObject ( IntPtr handle, Int32 milliseconds ) : WAIT_RESULT
XpsPrintHelper ( ) : Aspose.Diagram

No ctor.

Method Details

Print() public static method

Sends an Aspose.Diagram document to a printer using the XpsPrint API.
Thrown if any error occurs.
public static Print ( Diagram diagram, string printerName, string jobName, bool isWait ) : void
diagram Diagram
printerName string
jobName string Job name. Can be null.
isWait bool True to wait for the job to complete. False to return immediately after submitting the job.
return void

Print() public static method

Sends a stream that contains a document in the XPS format to a printer using the XpsPrint API. Has no dependency on Aspose.Diagram, can be used in any project.
Thrown if any error occurs.
public static Print ( Stream stream, string printerName, string jobName, bool isWait ) : void
stream Stream
printerName string
jobName string Job name. Can be null.
isWait bool True to wait for the job to complete. False to return immediately after submitting the job.
return void