View Single Post

   
  #6 (permalink)  
Old 01-05-2008, 08:14 AM
Michael Kraemer
 
Posts: n/a
Default Re: Printing from an application? Sample code anywhere?

In article <1124282422.684856.248280@g47g2000cwa.googlegroups .com>, "Torsten
Schlabach" <tschlabach@gmx.net> writes:
>
> Are you really telling me that the only way to print out something from
> an application is to write it to a temporary file and then issue a
> shell command through system?


Well, I'm not sure if it's the only way,
but it appeared to me as a pragmatic one.
When it comes to printing, it's mostly
about sending a PostScript file to a network printer.
And for that the shell command solution should be sufficient.

> I have a hard time believing this.
>


It's certainly not the most elegant one,
but the alternative would be to deal with the
intrinsics of AIX's queueing system, and I somehow
doubt that this would be less work than creating
a tmpfile and then dumping it to the printer.

I have a related problem: how to (quietly and portable) determine if
a given identifier is truely the name of an existing print queue,
and not just some plain file name or X $display.
"lpstat" wouldn't help I guess, since it's unclear if a
queue exists, but is down, or if it doesn't exist at all.
Reply With Quote