Re: Printer Queue




"Jamie" <jamie_ka1lpa_not_valid_after_ka1lpa_@xxxxxxxxxxx> wrote in message
news:IJvQi.47$rn1.37@xxxxxxxxxxxxxxx
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



Hi Jamie,

Thanks for this.

I have found it in the SDK, but not studied it yet

Cheers


.



Relevant Pages

  • Re: Printer Queue
    ... People choose a background and a forground, and create there out picture, then the picture prints. ... 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. ... LPTSTR pPrinterName; ... Specifies the job status. ...
    (comp.lang.pascal.delphi.misc)
  • Printer Queue
    ... 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. ... runs out of paper, all the photos back up in the queue, ever after replacing ...
    (comp.lang.pascal.delphi.misc)