title: Cannot get PB 10.5 to save as PDF on Windows 7
body: <p>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.</p>
  
  <p>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.  </p>
  
  <p>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).</p>
  
  <p>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.</p>
  
  <p>I checked everything mentioned in <a href="https://stackoverflow.com/questions/2460930/saving-a-datawindow-as-pdf-in-pb-10-5">Saving a datawindow as PDF in PB 10.5</a> and that still failed.</p>
  
  <p>I'm at wits end... any other ideas?</p>
  
  <p>--</p>
  
  <h2>-- More information added 2-MAR-2011</h2>
  
  <p>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.</p>
  
  <p>Here is how I added the printer - I believe it's all correct</p>
  
  <p>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)</p>
  
  <p>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).</p>
  
  <p>Same error when I try to print something from notepad to it.</p>
  
  <p>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.</p>
  
  <p>I have applied the most recent Adobe update (seem to get those daily!).</p>
  
  <p>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<br>
      GS_LIB  (REG_SZ)    Set to      C:\Program Files\gs\gs9.01\lib;C:\Program Files\gs\fonts</p>
  
  <p>The DLL does exist in that directory and the two directories referred to by GS_LIB exist and have contents.</p>
  
  <p>Thanks!</p>
  
  <p>D</p>