Re: Printer Queue



vertuas wrote:

Hi all,

I have written an autmated application that prints photographs off.

People choose a background and a forground, and create there out picture, then the picture prints.

I am however having some problems with the print queue. When the printer runs out of paper, all the photos back up in the queue, ever after replacing the paper the queue won;t clear. A restart still leave the queue full

Is the a way that i can clear the print queue?

Even better is there a way that i can tell that a document failed to print, so i can stop attempting to print more photos when there is a problem?

Thanks

Vert


If you look in the WIn32 help, You can use the
EnumJobs, and GetJob which will return data.
the handle you need would be that of what you're already
using from the assumed TPrinter unit.
One example of returned data.

DWORD JobId;
LPTSTR pPrinterName;
LPTSTR pMachineName;
LPTSTR pUserName;
LPTSTR pDocument;
LPTSTR pDatatype;
LPTSTR pStatus;
DWORD Status;
DWORD Priority;
DWORD Position;
DWORD TotalPages;
DWORD PagesPrinted;
SYSTEMTIME Submitted;
Status

Specifies the job status. This member can be one or more of the following values:

JOB_STATUS_DELETING
JOB_STATUS_ERROR
JOB_STATUS_OFFLINE
JOB_STATUS_PAPEROUT
JOB_STATUS_PAUSED
JOB_STATUS_PRINTED
JOB_STATUS_PRINTING
JOB_STATUS_SPOOLING

You need to specify at which level of information you need.
You can perform this in a wait state function loop after
you send a page and make sure the spooler is flushed.


--
"I'm never wrong, once i thought i was, but was mistaken"
Real Programmers Do things like this.
http://webpages.charter.net/jamie_5

.



Relevant Pages

  • Re: Printer Queue
    ... then the picture prints. ... I am however having some problems with the print queue. ... LPTSTR pPrinterName; ... Specifies the job status. ...
    (comp.lang.pascal.delphi.misc)
  • Re: Print Queue Wont Stay Up
    ... this printer stopped working right after the migration to AIX ... > Eliminate the queue from the picture. ...
    (comp.unix.aix)
  • Re: Print Queue Wont Stay Up
    ... All it did was go to the command prompt on the next line. ... > Eliminate the queue from the picture. ... >> The error code that displayed on the mail terminal is ...
    (comp.unix.aix)
  • Re: Print Queue Wont Stay Up
    ... Eliminate the queue from the picture. ... What happens when you cat file> ... absence of DCD on the serial port which would lead me to believe the problem ...
    (comp.unix.aix)