I have an application built in 10.5 that was able to successfully create PDFs using SaveAs on Windows XP. When I moved to Windows 7 (32-bit), it failed by returning -1 and a zero length file.
I have tried everything I can figure out. I have tried numerous version of Ghostscript (8.54, 8.71, 9.01), deleted the driver and re-added it. I copied the ghostscript EXEs and DLLs into my application directory as well.
System variables include a GS_DLL=C:\Program Files\gs\gs9.01\bin\gsdll32.dll and a PATH that has C:\Program Files\gs\gs9.01\bin\; in it (tried it listed first and last in the path).
When I add the 'Sybase DataWindow PS' printer, I specify 'C:\Program Files\gs\gs9.01\lib\' as the folder. I have tried sharing and not sharing the printer.
I checked everything mentioned in Saving a datawindow as PDF in PB 10.5 and that still failed.
I'm at wits end... any other ideas?
--
-- More information added 2-MAR-2011
I should note this is PB10.5 -- not sure that matters. I also have my Windows security set up so that I get all the annoying user account control message boxes.
Here is how I added the printer - I believe it's all correct
Add A Printer Use Existing Port, FILE: (Print to File) For Driver -- Have disk, selected "c:\Program Files\gs\gs9.01\lib\ghostpdf.inf" -- (replace current driver) Named it: Sybase DataWindow PS (confirmed the spelling)
When I print a test page it creates a 177KB PDF file, but when I open it, I get an error: "Adobe Reader could not open 'test.pdf' because it is either not a supported file type or because the file has been damaged (for example, it was sent as an email attachment and wasn't correctly decoded).
Same error when I try to print something from notepad to it.
When I print from the PB app using dw_1.saveAs( "c:\test\test.pdf", PDF! ) it returns a -1 and creates a 0 sized PDF.
I have applied the most recent Adobe update (seem to get those daily!).
I confirmed I have a registry key HKLM\SOFTWARE\GPL Ghostscript\9.01\ with values:
GS_DLL (REG_SZ) Set to C:\Program Files\gs\gs9.01\bin\gsdll32.dll
GS_LIB (REG_SZ) Set to C:\Program Files\gs\gs9.01\lib;C:\Program Files\gs\fonts
The DLL does exist in that directory and the two directories referred to by GS_LIB exist and have contents.
Thanks!
D