[gs-devel] Ghostscript with Vista

Ken Sharp ken.sharp at artifex.com
Wed Mar 5 09:08:25 PST 2008


At 11:36 05/03/2008 -0500, you wrote:

>I'm using PowerBuilder (PowerBuilder's a development IDE that supports 
>ghostScript to create PDFs) to write a program that exports data to 
>PDFs.  Ghostscript does this by installing a printer on the system.

Ghostscript doesn't, the pdfwrite device is built in to the Ghostscript 
executable. I think it likely that PowerBuilder is doing this:

Install the Redmon Port Monitor, attach a PostScript device driver to it, 
and have RedMon execute Ghostscript to convert the PostScript data stream 
produced by the driver into PDF.


>   To run the program, you must install ghostscript ( gs706w32.exe 
> ).  When we use Vista, it no longer works because Vista doesn't allow 
> kernel-mode access for print drivers.

Well, RedMon is a Port Monitor, not a print driver, but Port Monitors are 
part of the print subsystem. This has changed with Vista, but the printer 
driver itself should work fine.

To check, open the control panel, select printers, find the 'PDF converter' 
(or whatever its called) printer. Right-click it select 'Properties from 
the context menu, then choose the 'Ports' tab. Change the port from RedMon 
(or whatever it says) to FILE:

If you print to it now, then it should pop up and ask for a file 
destination. All this assumes that its only the installation of the port 
monitor which fails. I can't really comment, not having tried PowerBuilder.


>I'm not sure if it's PB that's installing the printer in kernel-mode, or 
>if it's part of GS.  I'm assuming you don't know anything about PB, but 
>judging from your e-mail I'd imagine GS doesn't do anything on the driver 
>level.

There's a distinction between Ghostscript and RedMon, or whatever 
PowerBuilder is installing. Broadly speaking you need a printer driver to 
convert the application's GDI calls into something a printer can 
understand. In your case that will be the Windows PostScript driver, 
possibly with a device-specific PPD.

That PostScript is then fed to a port, normally a printer port like LPT1:, 
but it can be any port. If RedMon is installed then it will be a 
'redirection' port. This will take the PostScript stream created by Windows 
and feed it to Ghostscript with the pdfwrite device selected, which will 
create a PDF file.

Ghostscript isn't (usually at least) installed in the kernel, and the 
printer driver itself is supplied with Windows, so whatever privilege level 
it runs at, it must be OK or the system wouldn't be able to print.

Which means the culprit is likely to be Redmon or some other port monitor, 
not Ghostscript.

I think its still possible to create a port monitor, because the XPS 
printer, supplied with Vista, seems to use a port monitor. However, the 
details may well have changed.


>A co-worker of mine told me that the problem is that Ghostscript uses 
>Acrobat 5, which handles the print driver side of things, uses kernel-mode 
>access.

No, I'm afraid your co-worker is incorrect. Ghostscript is itself a 
PostScript interpreter (amongst other things) and does native conversion. 
It does not use Acrobat.


>Let me know if you can shed any light onto this subject, thanks.

Well, hopefully some of the above makes sense :-)

Where you go from here I'm not sure.

That's a *really* old version of Ghostscript for starters, we're on 8.62 at 
the moment, and you should really use a more up to date version, especially 
for PDF output as there have been a number of improvements.

However, your real problem seems to be RedMon, or possibly the way that 
PowerBuilder installs it, not Ghostscript. You may be able to do better if 
you try installing the port monitor as Administrator. That is, use the 'run 
as administrator' context menu item when starting the installer, Vista is a 
bit 'different' to old versions of Windows in the way it treats 
administrators...

I'm afraid it doesn't look like anyone is currently supporting RedMon, so 
you're probably on your own, you may be able to alter it, but I'm not clear 
on where the actual problem lies, possibly its in PowerBuilder.

If its PB that's at fault then you'll have to go to Sybase to see if 
they'll fix it for you. Have you taken this up with Sybase support ? They 
may be able to help more.



                             Ken



More information about the gs-devel mailing list