Per other feedback it appears that this patch is causing issues with a different component (Redmon.exe) rather than this component?
↧
New Post: Window Patch Breaks PrinterQueueWatch
↧
New Post: Window Patch Breaks PrinterQueueWatch
Problem turned out to be that the patch blocks access to the separator page. Moved the separator page to the windows32 directory and all is well.
↧
↧
New Comment on "Getting started"
Hi, thank you for component. I have a question, please: If duplex printing, how to get information about it?
↧
New Post: How to read PrintQueueStream
I am trying to read the PrintQueueStram, but it is "Nothing". How do I get at the spooled print job's data?
↧
New Post: How to read PrintQueueStream
See this example...
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using PrinterQueueWatch;
namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
Printer p = new Printer();
p.StartWatching("Bullzip PDF Printer");
}
}
class Printer
{
private PrinterMonitorComponent mPr;
public void StartWatching(string PrinterDeviceName)
{
mPr = new PrinterMonitorComponent();
mPr.MonitorPrinterChangeEvent = false;
mPr.JobAdded += Addedtest;
try
{
mPr.DeviceName = PrinterDeviceName;
}
catch (Exception e)
{
Console.WriteLine(e.Message + "\n==================" + e.StackTrace);
}
}
public void Addedtest(object sender, PrintJobEventArgs e)
{
Console.WriteLine("Impressora: " + e.PrintJob.PrinterName);
Console.WriteLine("Usuário: " + e.PrintJob.UserName);
Console.WriteLine("Documento: " + e.PrintJob.Document);
Console.WriteLine("Páginas: " + e.PrintJob.TotalPages);
Console.WriteLine("Data Impressão: " + e.PrintJob.Submitted);
}
}
}
↧
↧
New Post: How to read PrintQueueStream
Do you want to get at the print job's actul data - i.e. the printer control language for each page in the job or just metadata about the job (such as what paper size and number of copied etc.)?
There is no code for the former in this library - although possibly the code in PrintJob.Transfer() might be a starting point....
There is no code for the former in this library - although possibly the code in PrintJob.Transfer() might be a starting point....
If OpenPrinter(Me.UniquePrinterObject, phPrinter, pDefault) Then
If phPrinter.ToInt64 <> 0 Then
'Read this print job into a bit of memory....
Dim ptBuf As IntPtr
Try
ptBuf = Marshal.AllocHGlobal(Me.JobSize)
Catch exMem As OutOfMemoryException
Throw New PrintJobTransferException("Print job is too large", exMem)
Exit Sub
End Try
'\\ Read the print job in to memory
Dim pcbneeded As Integer
If Not ReadPrinter(phPrinter, ptBuf, Me.JobSize, pcbneeded) Then
Throw New PrintJobTransferException("Failed to read the print job", New Win32Exception)
Exit Sub
End If
Dim DataFile As New PrinterDataFile(ptBuf, Me.DataType)
↧
New Post: How to read PrintQueueStream
I'll give this a tray today.
↧
New Post: How to read PrintQueueStream
Ideally I want the actual print job data and not metadata. The goal is to extract some of the text sent to the printer from another application.
↧
New Post: Monitor all print queues computer
I am developing an application to monitor print queues computer.
I wrote a code to call the method several times StartWatching, using threads, but is repetindos several times in execution.
I wrote a code to call the method several times StartWatching, using threads, but is repetindos several times in execution.
Printer p = new Printer();
Filas f = new Filas();
//f.CadastroFilas();
List<string> filas = f.recuperaFilas();
Thread[] exec = new Thread[filas.Count];
for (int i = 0; i < filas.Count; i++)
{
ParameterizedThreadStart start = new ParameterizedThreadStart(p.StartWatching);
exec[i] = new Thread(start);
exec[i].Start(filas[i]);
}
class Printer
{
private PrinterMonitorComponent mPr;
public void StartWatching(object PrinterDeviceName)
{
mPr = new PrinterMonitorComponent();
mPr.MonitorPrinterChangeEvent = false;
mPr.JobAdded += PegaSpool;
try
{
mPr.DeviceName = PrinterDeviceName.ToString();
}
catch (Exception e)
{
Console.WriteLine(e.Message + "\n==================" + e.StackTrace);
}
}
Is there any other method in printerqueuewatch to perform this operation without using threads?↧
↧
New Post: Monitor all print queues computer
I solved the problem by using an array of objects of type PrintMonitor.
thank you
thank you
p[i] = new Printer();
p[i].StartWatching(filas[i]);
↧
New Post: How to read PrintQueueStream
For that you would definitely need to use ReadPrinter (as above).
What makes it more tricky is that the print job data will be in one of many possible printer control languages such as EMF, PostScript, PCL-5, PCL-6 or HP-GL. You'd need to write a decoder plug-in for each printer language you encounter.
What makes it more tricky is that the print job data will be in one of many possible printer control languages such as EMF, PostScript, PCL-5, PCL-6 or HP-GL. You'd need to write a decoder plug-in for each printer language you encounter.
↧
New Post: Problem with duplex printing change
Good afternoon, I'm trying to modify the DUPLEX parameter value of a document being printed in SIMPLEX from adobe, in the event JobAdded, but can not get the job change SIMPLEX to DUPLEX.
In what way could do this?
Greetings and thanks.
In what way could do this?
Greetings and thanks.
↧
New Post: Problem with duplex printing change
You will first need to check you have permission to change any job settings - usually this requires it to be your print job or for you to be running as a user that has PRINTER_ACCESS_ADMINISTER rights.
The duplex property is a member of the DEVMODE structure. It is not currently exposed in the PrintJob class but can easily be done. (See how PrintJob.Color is done for example)
The possible settings are:
The duplex property is a member of the DEVMODE structure. It is not currently exposed in the PrintJob class but can easily be done. (See how PrintJob.Color is done for example)
The possible settings are:
' DeviceDuplexSettings is how a duplex device is set for duplex printing
Public Enum DeviceDuplexSettings
' DMDUP_SIMPLEX Device is not using double sided printing
DMDUP_SIMPLEX = 1
' DMDUP_VERTICAL Device is performing double sided printing on the short edge
DMDUP_VERTICAL = 2
' DMDUP_HORIZONTAL Device is performing double sided printing on the long edge
DMDUP_HORIZONTAL = 3
End Enum
↧
↧
Source code checked in, #72774
Additional logging in Trace when Verbose set
↧
Source code checked in, #72775
Added Duplex property to PrintJob (Read-Only)
↧
Closed Issue: System structures too small [7629]
We're using PrintQueueWatch in a service to obtain notification of and job information for jobs submitted to our data center for printing. However, we're seeing exceptions in the trace log indicating the size of a system structure is too small. For example,
PrinterQueueWatch.PrintJob: System.ComponentModel.Win32Exception: The data area passed to a system call is too small
at PrinterQueueWatch.SpoolerStructs.JOB_INFO_1..ctor(IntPtr hPrinter, Int32 dwJobId)
at PrinterQueueWatch.PrintJob.InitJobInfo()
and
PrinterQueueWatch.PrintJob: System.ComponentModel.Win32Exception: The data area passed to a system call is too small
at PrinterQueueWatch.SpoolerStructs.JOB_INFO_2..ctor(IntPtr hPrinter, Int32 dwJobId)
at PrinterQueueWatch.PrintJob.InitJobInfo()
I'm not sure how to proceed to resolve these issues. Can anyone offer any advice?
Thanks,
Pete Anfinsen
HealthPartners
PrinterQueueWatch.PrintJob: System.ComponentModel.Win32Exception: The data area passed to a system call is too small
at PrinterQueueWatch.SpoolerStructs.JOB_INFO_1..ctor(IntPtr hPrinter, Int32 dwJobId)
at PrinterQueueWatch.PrintJob.InitJobInfo()
and
PrinterQueueWatch.PrintJob: System.ComponentModel.Win32Exception: The data area passed to a system call is too small
at PrinterQueueWatch.SpoolerStructs.JOB_INFO_2..ctor(IntPtr hPrinter, Int32 dwJobId)
at PrinterQueueWatch.PrintJob.InitJobInfo()
I'm not sure how to proceed to resolve these issues. Can anyone offer any advice?
Thanks,
Pete Anfinsen
HealthPartners
↧
Closed Issue: Issue with PrintWatchQueue on 64 bit systems [4640]
Hello!
I have been trying to use the PrintWatchQueue component, but I have been running into an odd issue... When adding any printer using the .AddPrinter method I receive the following error:
Attempted to read or write protected memory. this is often an indication that other memory is corrupt.
I was using the latest version of the component (2.0.7.0) on a WindowsXP 64 box, Visual Studio 2005. When I tried to open the source code, I discovered it was written in VS 2008. Thinking that it might be a problem with the target CPU, I loaded the source code in a Server 2008 (32 bit)/VS 2008 virtual machine that I have. I checked - the target CPU was set to "Any CPU", so that wasn't the problem...
I recompiled anyhow, and copied the new dll back to my application on the 64 bit machine. Ran the program - encountered the same error. I then switched gears, and moved my app to the virtual machine. Converted the project to VS2008, compiled and ran it - BINGO! No error! Interesting - is this a 32 bit vs. 64 bit Framework issue? On to further investigation...
I needed to debug your source code to identify the location of the error, but the only source I had was VS 2008. So, I dug around a bit on MerrionComputing.com and on the CodePlex PUMA site. I found that the PrintQueueWatch code in the PUMA source was VS 2005. I recompiled the code, replaced the dll in my app, and was able to establish debugging. Here is what I found:
When I call the .AddPrinter method, the code executes successfully through creating a New PrinterInformation class when the DesiredAccess is set to 131080, but when it tries to create the class with DesiredAccess set to PrinterAccessRights.PRINTER_ALL_ACCESS (983052) the code throws theprotected memory error.
So there is the source of the error, but my knowledge of the Printer world is much too limited for me to make any sense of it. Do you have any ideas?
Thanks,
Eric
I have been trying to use the PrintWatchQueue component, but I have been running into an odd issue... When adding any printer using the .AddPrinter method I receive the following error:
Attempted to read or write protected memory. this is often an indication that other memory is corrupt.
I was using the latest version of the component (2.0.7.0) on a WindowsXP 64 box, Visual Studio 2005. When I tried to open the source code, I discovered it was written in VS 2008. Thinking that it might be a problem with the target CPU, I loaded the source code in a Server 2008 (32 bit)/VS 2008 virtual machine that I have. I checked - the target CPU was set to "Any CPU", so that wasn't the problem...
I recompiled anyhow, and copied the new dll back to my application on the 64 bit machine. Ran the program - encountered the same error. I then switched gears, and moved my app to the virtual machine. Converted the project to VS2008, compiled and ran it - BINGO! No error! Interesting - is this a 32 bit vs. 64 bit Framework issue? On to further investigation...
I needed to debug your source code to identify the location of the error, but the only source I had was VS 2008. So, I dug around a bit on MerrionComputing.com and on the CodePlex PUMA site. I found that the PrintQueueWatch code in the PUMA source was VS 2005. I recompiled the code, replaced the dll in my app, and was able to establish debugging. Here is what I found:
When I call the .AddPrinter method, the code executes successfully through creating a New PrinterInformation class when the DesiredAccess is set to 131080, but when it tries to create the class with DesiredAccess set to PrinterAccessRights.PRINTER_ALL_ACCESS (983052) the code throws theprotected memory error.
So there is the source of the error, but my knowledge of the Printer world is much too limited for me to make any sense of it. Do you have any ideas?
Thanks,
Eric
↧
↧
Closed Issue: Alter PRINTER_INFO_2 to move the DEVMODE [978]
The PRINTER_INFO_2 structure size is too big because of a local variable to DEVMODE.
This needs to be factored out into a new superclass so that Marshal.SizeOf(PRINTER_INFO_2) returns the expected result.
This needs to be factored out into a new superclass so that Marshal.SizeOf(PRINTER_INFO_2) returns the expected result.
↧
Created Unassigned: PrinterQueueWatch - event not firing on my computer [10126]
The PrinterQueueWatch events are NOT firing on my computer but they ARE working for a co worker. The computer that IS working is 32 bit and mine that is not working is 64. Is that the difference? If so is there a workaround?
↧
Commented Unassigned: PrinterQueueWatch - event not firing on my computer [10126]
The PrinterQueueWatch events are NOT firing on my computer but they ARE working for a co worker. The computer that IS working is 32 bit and mine that is not working is 64. Is that the difference? If so is there a workaround?
Comments: ** Comment from web user: mptl **
Comments: ** Comment from web user: mptl **
this is a known issue, check https://printqueuewatch.codeplex.com/workitem/9291
↧