Board index » delphi » Print queues

Print queues

Can I print from a Pascal program into a printqueue without having a capture? and can I get
information from this queue? e.g. how many jobs are waiting because the printer is off-line?

Thanks...Kees

*=*=*=*=*=*=*=*=*=*=*=*
* Kees Hiemstra
* PO.Box 5019
* 2701 GA Zoetermeer
* The Netherlands
*

 

Re:Print queues


     Under DOS, you can have the PRINT TSR loaded first and then, using
normal print procedures, load the print queue.  You can also use
interrupts to enquire of the TSR.
           Joel in Ogden

Re:Print queues


Diese Nachricht antwortet auf einen Text,
den c...@xs4all.nl am Freitag, den 26.07.96,
durch die Datennetze geschossen hat:

KH> Can I print from a Pascal program into a printqueue without having a
KH> capture? and can I get information from this queue? e.g. how many jobs are
KH> waiting because the printer is off-line?
you should say under which OS you're working!
DOS uses PRINT for spooler-services, windows is a bit more complicated!

say a little bit more about your problem!

bye
   TiO

Re:Print queues


In article <4t9qrv$...@newsbf02.news.aol.com>,

Quote
JWillard44 <jwillar...@aol.com> wrote:
>     Under DOS, you can have the PRINT TSR loaded first and then, using
>normal print procedures, load the print queue.  You can also use
>interrupts to enquire of the TSR.
>           Joel in Ogden

Wrong! The print queue is not loaded "using normal print procedures".
Instead one has to call multiplex interrupt to put files into the queue.

Here are some examples:

var dos3:boolean;
...
dos3:=swap(dosversion)>=$300

Function PrintInstalled:Boolean;
var rg:registers;
Begin
  if not dos3 then printinstalled:=false
    else begin
      rg.ax:=256;
      Intr($2f,rg);
      PrintInstalled:=rg.al=255;
    end;
End;

Procedure PrintFile(st:string; var error:boolean);
var rg:registers;
    sb:record
         code:byte;
         ofs,seg:word;
       end;
Begin
  if not PrintInstalled then error:=true
  else begin
    sb.code:=0;
    sb.ofs:=ofs(st[1]);
    sb.seg:=seg(st);
    st:=fexpand(st)+#0;
    rg.ds:=seg(sb);
    rg.dx:=ofs(sb);
    rg.ax:=$0101;
    intr($2f,rg);
    error:=rg.flags and fcarry <>0
 end;
End;

Procedure UnPrintFile(st:string);
var rg:registers;
begin
  rg.dx:=ofs(st[1]);
  rg.ds:=seg(st);
  st:=fexpand(st)+#0;
  rg.ax:=$0102;
  intr($2f,rg);
end;

Procedure ClearPrintQueue;
begin
  {asm
  mov ax,103h
  int 2fh
  end}
  Inline($B8/$03/$01/$CD/$2F);
end;

See more info from Ralf Brown's interrupt list.

Osmo

Re:Print queues


Quote
ronka...@cc.helsinki.fi (Osmo Ronkanen) wrote:
> Wrong! The print queue is not loaded "using normal print
> procedures".  Instead one has to call multiplex interrupt to
> put files into the queue.

You are right, I don't know what I was thinking, or if I was even thing.
Thank-you for setting the record straight.

Re:Print queues


Quote
Kees Hiemstra wrote:

> Can I print from a Pascal program into a printqueue without having a capture? and can I get
> information from this queue? e.g. how many jobs are waiting because the

I can think up 2 ways: either be lazy and use the external PRINT.EXE of
dos (and use INT $2f (I think) to get info on what files are in que) or
else use a simple stack (via an array or collection) then hook to INT 1C
to print in the background.

Re:Print queues


In article <320005EF.5...@maltanet.omnes.net>,
Wallace Wadge  <wall...@maltanet.omnes.net> wrote:

Quote
>Kees Hiemstra wrote:

>> Can I print from a Pascal program into a printqueue without having a capture? and can I get
>> information from this queue? e.g. how many jobs are waiting because the
>I can think up 2 ways: either be lazy and use the external PRINT.EXE of
>dos (and use INT $2f (I think) to get info on what files are in que) or
>else use a simple stack (via an array or collection) then hook to INT 1C
>to print in the background.

And the lazy method is better as you can quit the program while the
printing is on.

Osmo

Other Threads