Tuesday, August 11, 2015

Installing Ghostscript on Windows 10

One of the lack of Powerbuilder feature or function is the native exporting the datawindow object into PDF format. Yes, you can use the SaveAs function in the datawindow object, but for PDF format, you need 3rd party application called Ghostscript to be installed on your PC.


You can download the Ghostscript from http://www.ghostscript.com

Once you done with the installation, Ghostscript will create a printer device on your PC called Sybase Datawindow PS, then you just need to add the Powerbuilder script to print the datawindow object like below:

dw_1.SaveAs(<filename.pdf>,PDF!,false)

But, the problem will occur if you are using Windows 10, and I am sure it will be the same if you are using Windows 8/8.1 as well.

The Sybase Datawindow PS printer will not created automatically if you install on the Windows 8/8.1/10. You have to create or adding the printer manually, and even then you have to change the Windows setting before you can add the device.

Since I am using Windows 10, and skip version 8/8.1, here's the tip and trick how to install Ghostscript in Windows 10:

  • Open the "Settings", you can click Start button the choose the menu Settings
  • Click menu: "Update & security" at the button of Settings window.
  • At the left menu bar, choose "Recovery"
  • Click button "Restart now", under "Advanced startup"
  • Window will restart
  • Click "Troubleshoot", then "Advanced Option", then "Startup Settings"
  • Click "Restart"
  • After restart, press 7 on your keyboard to choose the menu "Disable Driver Signature Enforcement"
  • Then now you can add the Sybase Datawindow PS printer


To adding the printer manually:

  • Open the "Settings", you can click Start button the choose the menu Settings
  • Click menu: "Devices" then click button "Add a printer or scanner"
  • Window will searching for the device, skip it by clicking "The printer that I want isn't listed"
  • Choose the option "Add a local printer or network printer with manual settings" at the bottom, then click "Next"
  • At the "User an existing port:" dropdown list, choose: FILE: (Print to File) option, then click "Next"
  • Click button "Have Disk..." then pointing the directory to : "C:\Program Files\GS\GSxxx\LIB" the xxx is ther Ghostscript version that you installed
  • Search the file name is: GHOSTPDF.INF then click "OK"
  • The printer: Ghostscript PDF will shown at the list, choose it then click "Next"
  • Name the printer "Sybase DataWindow PS" and please DO NOT change it into another name. Don't ask me why!
  • Also DO NOT set it as the default printer.
  • Click "Next" then "Finish"
  • If you receive a message about the driver being unsage to install, ignore it and click "Install Anyway"


1 comment :

  1. hi,
    I am having problem in coding
    My requirement is same as we comment in some forum
    like once we clicked on comment box textbox should appear and if again we went then it should display like a text in a non editable mode.

    ReplyDelete