PrinterQueueWatch 1.0.0

Library for monitoring print queues on windows

Install-Package PrinterQueueWatch -Version 1.0.0
dotnet add package PrinterQueueWatch --version 1.0.0
<PackageReference Include="PrinterQueueWatch" Version="1.0.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add PrinterQueueWatch --version 1.0.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: PrinterQueueWatch, 1.0.0"
#r directive can be used in F# Interactive, C# scripting and .NET Interactive. Copy this into the interactive tool or source code of the script to reference the package.
// Install PrinterQueueWatch as a Cake Addin
#addin nuget:?package=PrinterQueueWatch&version=1.0.0

// Install PrinterQueueWatch as a Cake Tool
#tool nuget:?package=PrinterQueueWatch&version=1.0.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

Getting started with the PrintQueueWatch component

The getting started page is a quick and dirty subset of the documentation based on the format: _"I want to ....." _

I want to ... get a list of all the documents that are printed on one printer

In order to get a list of the documents printed on a printer you need to monitor that printer and when you get a JobWritten event check if the .Printed property is true and if so, make a note of that print job's details.

** Step 1 : Add the PrintQueueWatch component to your project**
To do this slect Project → References and add a reference to the latest PrintQueueWatch.dll to your project

** Step 2: Add an instance of the component on your form**
Drag the component from the toolbox onto your form surface. Visual Studio will create an instance and wire it up.

{"
Imports PrinterQueueWatch

Public Class Form1
Inherits System.Windows.Forms.Form

Private WithEvents pmon As New PrinterMonitorComponent

"}

** Step 3: Add an event handler to handle the JobAdded event**
{"
Private Sub pmon_JobAdded(ByVal sender As Object, ByVal e As PrintJobEventArgs) Handles pmon.JobAdded

    With CType(e, PrintJobEventArgs)
        Trace.WriteLine(.PrintJob.UserName)
    End With

End Sub

"}

** Step 4: Add the printers to monitor**
In the form load event handler add all the local device names to the list of printers to monitor

{"
Public Sub New()
MyBase.New()

    'This call is required by the Windows Form Designer.
    InitializeComponent()

    'Add any initialization after the InitializeComponent() call
    For Each p As PrinterInformation In New PrinterInformationCollection
        pmon.AddPrinter(p.PrinterName)
        Trace.WriteLine(String.Format("Printer {0} added to monitor", p.PrinterName))
    Next p

End Sub

"}

** Step 5: Add code to close the monitoring nicely**
Add the following in the form unload handler
{"
Private Sub Form1_Closing(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles MyBase.Closing
Try
pmon.Dispose()
Catch EX As Exception
Trace.WriteLine(EX.ToString)
End Try
End Sub
"}

Getting started with the PrintQueueWatch component

The getting started page is a quick and dirty subset of the documentation based on the format: _"I want to ....." _

I want to ... get a list of all the documents that are printed on one printer

In order to get a list of the documents printed on a printer you need to monitor that printer and when you get a JobWritten event check if the .Printed property is true and if so, make a note of that print job's details.

** Step 1 : Add the PrintQueueWatch component to your project**
To do this slect Project → References and add a reference to the latest PrintQueueWatch.dll to your project

** Step 2: Add an instance of the component on your form**
Drag the component from the toolbox onto your form surface. Visual Studio will create an instance and wire it up.

{"
Imports PrinterQueueWatch

Public Class Form1
Inherits System.Windows.Forms.Form

Private WithEvents pmon As New PrinterMonitorComponent

"}

** Step 3: Add an event handler to handle the JobAdded event**
{"
Private Sub pmon_JobAdded(ByVal sender As Object, ByVal e As PrintJobEventArgs) Handles pmon.JobAdded

    With CType(e, PrintJobEventArgs)
        Trace.WriteLine(.PrintJob.UserName)
    End With

End Sub

"}

** Step 4: Add the printers to monitor**
In the form load event handler add all the local device names to the list of printers to monitor

{"
Public Sub New()
MyBase.New()

    'This call is required by the Windows Form Designer.
    InitializeComponent()

    'Add any initialization after the InitializeComponent() call
    For Each p As PrinterInformation In New PrinterInformationCollection
        pmon.AddPrinter(p.PrinterName)
        Trace.WriteLine(String.Format("Printer {0} added to monitor", p.PrinterName))
    Next p

End Sub

"}

** Step 5: Add code to close the monitoring nicely**
Add the following in the form unload handler
{"
Private Sub Form1_Closing(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles MyBase.Closing
Try
pmon.Dispose()
Catch EX As Exception
Trace.WriteLine(EX.ToString)
End Try
End Sub
"}

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version History

Version Downloads Last updated
1.0.0 36 4/8/2021