[bug-gswin] Using windows print.exe command

Robert Mecklenburg mecklen at cimsoft.com
Mon Nov 3 10:28:08 PST 2003


First, thank you for your reply.  I've subscribed to the list so I
can participate in this conversation more easily...

RM> I'm trying to print a pdf file to a network-accessible printer.  I
RM> saw the post in July by Eugen Ostrowski requesting the same feature
RM> but no response.

RJ> From Windows, the simplest way is to use the "Add Printer" wizard to
RJ> add a printer connection to the network printer. The first non-trivial
RJ> dialog in this wizard asks for "Local Printer" or "Network Printer".
RJ> Select "Network Printer" and proceed through the wizard to establish
RJ> a printer on your system to the network accessible printer.
RJ> 
RJ> Then you can select this printer from the dialog that Ghostscript pops
RJ> up when using the mswinpr2 driver, or you can select it as the printer
RJ> when printing from Adobe Acrobat Reader.

The code I'm writing will be run from a Weblogic server, locked in a
room, with no user to add printers, see or click on dialog boxes, etc.
The clients that want to do the printing will be located many miles
away, but will be within the same network domain across a vpn.


RM> It occurred to me that I might use the print.exe command to print to
RM> a network printer if I could get Ghostscript to write the proper
RM> file.  When using the windows interface I specify mswinpr2 and
RM> "magic" happens to select the proper output format.  I'm assuming (I
RM> know, I know) that gs is writing some kind of magic windows format
RM> and that windows is performing the printer-specific translation.  If
RM> this assumption is true, is it possible to get gs to write this
RM> format to a file so I can feed it to print.exe?

RJ> If you have a "Local printer" of the same type as the network printer,
RJ> you can select the "Port" for the local printer as "FILE:" or in the
RJ> "Print" dialog that the mswinpr2 pops up, you can click on the
RJ> "Print to file" button. Then you will be prompted for a file name
RJ> where the driver will write the printer specific data.

The server will have no printers attached and we do not know in
advance the printer type of the client.  I have a knowledge base
article on how to add printers using a command line tool, but this
feels wrong since print.exe can print to non-added printers.


RM> If not, is there any output format I can select in gs that print.exe
RM> will work with when I don't know the printer type?

RJ> No. The mswinpr2 device gets a full page bitmap from Ghostscript and
RJ> sends it to Windows using GDI calls. This needs to be converted to
RJ> the specific printer format by the Windows driver.

But this is almost what I want.  You say that "mswinpr2 device gets a
full page bitmap", if I could get this bitmap and print it myself
with print.exe I'd be a happy camper.

- I just tried printing a simple tiff file using "print foo.tif" and
  it failed to print properly (printed the "data" as glyphs not
  pixels).

- Now I've tried printing the tiff from the Windows Picture and Fax
  Viewer and it worked.  I'm now trying to figure out how to link the
  print.exe command to the Picture Viewer using document types.

I'll report back when I learn more.

Thanks!
-- 
Robert



More information about the bug-gswin mailing list