Questions tagged [print-spooler-api]

The API to access and manipulate a print spooler

A print spooler is a software package in an operating system that provides queueing functionality to queue documents sent to the printer to print.

A print spooler API allows a programmer to manipulate the queue of documents to be printed (a.k.a the print spool).

88 questions
17
votes
2 answers

How do I find the spool file for the job with a given ID even when spool file pooling is enabled?

I would like to copy the spool data for a given Windows print job to an arbitrary location on disk. I have the job ID of the print job from the Print Spooler API. I know this job has finished spooling. I know the job won't be deleted before I have…
Redwood
  • 66,744
  • 41
  • 126
  • 187
6
votes
4 answers

Use PrintSpoolerAPI function SetForm() in C#

I am working on a Windows Forms Application in which I want to print a custom document. This custom document is of custom size and I have to set the default print page size using C# code. I did some google search and came across PrintSpoolerAPI. The…
Nilesh Barai
  • 1,312
  • 8
  • 22
  • 48
6
votes
2 answers

Getting the user's domain name for a print job from the Print Spooler API

How can I get the domain name of the user making a print given the Job ID of the print? I can get the user's name from, e.g., the JOB_INFO_2 retrieved via GetJob, but none of the JOB_INFO_# structures contain the user's domain name. I can get the…
Redwood
  • 66,744
  • 41
  • 126
  • 187
6
votes
2 answers

Developing a custom printer driver for Windows

For the needs of my software I need to create a printer driver which will allow me to save all the images which are sent to it to files and then open my program's window letting the user to do something with the rendered pages. I have found this…
Cracker
  • 912
  • 2
  • 14
  • 26
4
votes
1 answer

How to detect printing app when splwow64.exe is involved?

We have a print driver that captures the name of the printing exe within the driver's UI module. It does this by using the GetModuleFileName function. This works well until a 32-bit prints on a 64-bit machine. In that scenario Windows invokes…
Carey Gregory
  • 6,836
  • 2
  • 26
  • 47
4
votes
1 answer

When job is printed, last job status is JOB_STATUS_RETAINED, instead of JOB_STATUS_PRINTED

I poll printer queue on any change like JOB_CHANGE, and if I see that some job disappeared, I report to server that job has been printed or deleted, according to job last status. Problem is that printer Lexmark X945e returned last job status only…
DevOvercome
  • 151
  • 1
  • 12
3
votes
3 answers

Can I use WMI to read a printer spool file

My client has an old DOS-based application which sends formatted output to a printer. I have disabled printing so spooled files remain in the print queue. I would like to pick up these spool files and convert them to PDF format (then ideally delete…
Mart
  • 31
  • 1
2
votes
1 answer

Programmatically Block Printing requests for specifice file(.txt extension)?

I have captured the print event for a specific file(.txt extension). Now I want to block this print event request for that specific file. Is there any way to block the printing job for the specific file(extension .txt) programmatically? I'm using…
Danish
  • 792
  • 1
  • 5
  • 14
2
votes
1 answer

Programatically print PDF file using Windows Spooler API

Is it possible to print a PDF file from using windows Spooler API. I tried with below code and it is not working... int print_handle = 0; OpenPrinter(pPrinterName, &print_handle, NULL); if (print_handle == 0) { return 0; } docinfo1.pDocName…
DAC84
  • 421
  • 1
  • 8
  • 20
2
votes
0 answers

debug a custom windows print processor?

Working with the Windows Driver Development Kit sample package (v 8.1), I found a sample print processor implementation that I tried to use as a starting point for my own custom print processor ("GenPrint Print Processor Sample"). I managed to…
2
votes
1 answer

How to programmatically achieve editing of the spool file header of the normal windows print queue 'spool file' before it is sent to the printer?

How to intercept and change the windows 7 print spool file (.SPL) to add some additional information in the header like '@PJL SET NAME="PainPoint" ' before this file is sent to the printer during the execution of the print job? The .SPL file partial…
PainPoints
  • 461
  • 8
  • 20
2
votes
0 answers

Access denied on DocumentProperties call after impersonation when running 32bit applicaiton on 64bit Windows 10

I have the need to get a printers DEVMODE structure after my application has impersonated a user. This works fine as long as my Architecture matches that of the Windows, 32bit application running on a 32bit OS, and vice versa. However, any call I…
Wizetux
  • 756
  • 3
  • 12
2
votes
1 answer

FindNextPrinterChangeNotification misses events?

I am using FindFirstPrinterChangeNotification and FindNextPrinterChangeNotification to catch printing events. However I have noticed that FindNextPrinterChangeNotification does not reliably returns all the events. I have found a guy with the same…
Luke Vo
  • 17,859
  • 21
  • 105
  • 181
2
votes
3 answers

Checking Print Spooler status (running or not)

I need to detect whether the Print Spooler service is running. I can find various resources for VB.NET (e.g., using ServiceProcess.ServiceController to actually manipulate the service), but nothing for VB6. Is there any way to check whether the…
Jon Story
  • 2,881
  • 2
  • 25
  • 41
2
votes
1 answer

EnumJobs returning a different JOB_INFO_1 size than Marshal.SizeOF

I'm calling the Win32 function EnumJobs (http://msdn.microsoft.com/en-us/library/windows/desktop/dd162625(v=vs.85).aspx) from managed code (C#). [DllImport("Winspool.drv", SetLastError = true, EntryPoint = "EnumJobsA")] public static extern…
probably at the beach
  • 14,489
  • 16
  • 75
  • 116
1
2 3 4 5 6