Search code examples
c#printingghostscriptfailovercluster

How do I make ghostscript print pdf to a cluster fail over local queue?


I have an application that performs printing physical documents in local queues. However, as this application runs on a cluster fail over environment, I can not list or use the print queues from the fail over cluster environment. The Ghostscript lists only the queues from the local server (as a stand alone installation).

Is there any way to print using the cluster queue without sharing (install) it madly?

I'm using the command line for this purpose:

-q -dBATCH -dNOPAUSE -dNODISPLAY   -c  "mark /Duplex true /NoCancel true   /OutputFile (%printer%Ricoh c2051) /UserSettings << /DocumentName  (Test) >> (mswinpr2)finddevice putdeviceprops setdevice"  -f "duplex.pdf"

using \ server \ printer name does not work.


Solution

  • No, there is no way to make Ghostscript print to a printer which is not available to the local system. I explained the reason for this in another post recently, but here it is again:

    When printing 'input' (PostScript, PDF, XPS, PCL, PXL) to a physical printer on a Windows system (so using the mswinpr2 device) Ghostscript does not need to know any characteristics of the printer. What it does is request the printer characteristics for the selected printer from Windows, it then renders the input to a bitmap of the required size,. It creates a Device Context compatible with the printer and blits the bitmap to the device context. Then it tells the Device Context to print itself to the printer.

    Windows takes care of all the business of converting the bitmap into something suitable for the printer, by using the Windows printing subsystem, and in particular the windows printer driver.

    The upshot of this is that the mswinpr2 device can only print to a printer which is known to the Windows system it is running on. If you can't list the printer from Windows then mswinpr2 can't print to it.