PrintJob.PaperWidth Property

Gets the width of the paper to be used by this print job, in hundredths of an inch.

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

Property Value

Gets the width of the paper to be used by this print job, in hundredths of an inch. This value is only used if the PaperKind is PaperKind.Custom

Remarks

This measurement is for the portrait orientation of the paper. If Landscape property is set then width and height are reversed

Example

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

[Visual Basic] 
Private mPr As PrinterMonitorComponent

Public Sub StartWatching(ByVal PrinterDeviceName As String)

   mPr = New PrinterMonitorComponent()

   '\\ For efficieny reasons, do not monitor printer information changed events
   mPr.MonitorPrinterChangeEvent = False

   AddHandler mPr.JobAdded, AddressOf Addedtest

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

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

   With CType(e, PrintJobEventArgs).PrintJob
        Trace.WriteLine("** Paper Kind: " & .PaperKind.ToString)
        Trace.WriteLine("** Paper Length: " & .PaperLength.ToString)
        Trace.WriteLine("** Paper Width: " & .PaperWidth.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.