PrintJob.TotalPages Property

Gets the total number of pages in this print job

[Visual Basic]
Public ReadOnly Property TotalPages As Integer
[C#]
public int TotalPages {get;}
[C++]
public: __property int get_TotalPages();
[JScript]
public function get TotalPages() : int;

Property Value

Gets the total number of pages in this print job. This the number for one copy of the print job. If multiple copies are printed then the true page count may be found by multiplying the TotalPages by the Copies

Remarks

Example

[Visual Basic] The following example prints the details of a job to a trace when a job is deleted from the queue being monitored

[Visual Basic] 
Private mPr As PrinterMonitorComponent

Public Sub StartWatching(ByVal PrinterDeviceName As String)

   mPr = New PrinterMonitorComponent()

   AddHandler mPr.JobDeleted, AddressOf Deletedtest

   mPr.ThreadTimeout = -1
   mPr.DeviceName = PrinterDeviceName 
   
   
End Sub

Public Sub Deletedtest(ByVal sender As Object, ByVal e As EventArgs)

   With CType(e, PrintJobEventArgs).PrintJob
	Trace.WriteLine("Job deleted : - Details...")
        Trace.WriteLine("** Colour: " & .Color.ToString)
        Trace.WriteLine("** Copies: " & .Copies.ToString)
        Trace.WriteLine("** Data Type: " & .DataType)
        Trace.WriteLine("** Document: " & .Document)
        Trace.WriteLine("** Printer Driver: " & .DriverName)
        Trace.WriteLine("** Landscape?: " & .Landscape.ToString)
        Trace.WriteLine("** Machine: " & .MachineName)
        Trace.WriteLine("** User to notify: " & .NotifyUserName)
        Trace.WriteLine("** Pages Printed: " & .PagesPrinted.ToString)
        Trace.WriteLine("** Paper Source: " & .PaperSource.ToString)
        Trace.WriteLine("** Position in the queue: " & .Position.ToString)
        Trace.WriteLine("** Printer Name: " & .PrinterName)
        Trace.WriteLine("** Printer Resolution: " & .PrinterResolutionKind.ToString)
        Trace.WriteLine("** Print Processor Name: " & .PrintProcessorName)
        Trace.WriteLine("** Parameters: " & .Parameters)
        Trace.WriteLine("** Print Processor: " & .PrintProcessorName)
        Trace.WriteLine("** Status: " & .StatusDescription)
        Trace.WriteLine("** Total pages: " & .TotalPages.ToString)
        Trace.WriteLine("** User name: " & .Username)
        Trace.WriteLine("** Paper Kind: " & .PaperKind.ToString)
        Trace.WriteLine("** Paper Length: " & .PaperLength.ToString)
        Trace.WriteLine("** Paper Width: " & .PaperWidth.ToString)
        Trace.WriteLine("** Status: Paused? " & .Paused.ToString)
        Trace.WriteLine("** Status: Deleted? " & .Deleted.ToString)
        Trace.WriteLine("** Status: Deleting? " & .Deleting.ToString)
        Trace.WriteLine("** Status: User intervention required? " & .UserInterventionRequired.ToString)
   End With

End Sub

Requirements

Namespace: PrinterQueueWatch

Platforms:  Windows NT 4.0, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows .NET Server family

See Also

PrintJob overview , All PrintJob members


© 2003 Merrion Computing Ltd. All rights reserved.