Installing GhostScript for PowerBuilder on Windows 10
GhostScript on Windows 10
PDF Generation for PowerBuilder Classic
Most PowerBuilder developers know that the DataWindow object class in PowerBuilder (PB) Classic utilizes the open source (GNU) version of the GhostScript (GS) software to convert PostScript printer output into an Adobe PDF (Portable Data Format) file. The challenge this year for PB Developers moving into the MS-Windows version 10 domain, is that all drivers must be signed in order for the new O/S to accept the driver. This creates an issue for the GS installation as even the latest version 9.16 does not supply signed MS-Windows drivers.
The good news though is that the PB Developer can get around this roadblock in the new O/S by following the procedure I used below to install GS v9.16. Without this technique, the GS install will not complete due to finding an unsigned driver. The install will in fact get stuck in a closed loop … select the .INF, get an unsigned driver message, click next, get an unsigned error and voila – your back at the select the .INF file part again in the MS-Windows 10 install printer wizard!
The following procedure is what I used to circumvent the unsigned GS driver issue in W10, as follows:
1) Hold down the SHIFT key while you click Restart.
2) Once your computer has rebooted, choose the Troubleshoot option.
3) Then select the Advanced options.
4) You will now be prompted to restart your Computer again.
5) After restarting, you will need to press the F7 key!
6) Now your PC will reboot and you will be able to install unsigned drivers without any error messages!
Now during the GhostScript installation, once you get to selecting the printer driver from the GS installation’s LIB folder, you should now see the MS-Windows security dialogue allowing the GS Driver to be installed even though its not signed!
Regards … Chris
Nice post Chris,
I wish we had this a couple of weeks ago. We have already broken this pain barrier as we test our latest release on W10.
I'm sure this will help a lot of people.
Cheers
David
Thanks David!
Yes, I had to scratch my head a few times (and loose some more hair) to finally find the real issue and a work around. However, after a few Tim Horton's coffees 😉 I was able to get the above to work. One happy camper I tell ya!
For production I would recommend looking at getting the GS driver signed. You can do that using various pieces of software. For example; Steps for Signing a Device Driver Package
The other alternative is to even go one step further and take GS out of the client picture and thus the entire W10 GS problem (for example - click here)
Regards ... Chris
PS: I am hoping that Appeon will embed their native PDF support into PB when SAP officially hands the product over to them soon. 😉
PPS: I believe that the above procedure will also work on W2012.
Hi Chris,
Nice Post thank you verymuch.
I have one issue while am saving dw using GS printer to a file, name as arabic ( 'اختبار.pdf' ), content is not saving so file size is 0, can you advice/ guide me.
FYI:- English Named Files are working fine with while saving DW.
the following message am getting while I try to open file.
Thanks in advance.
Regards
Antony
Hi Anthony;
I have never had to look into the Arabic support for GS here in Canada as we only support English & French. However, its my understanding that the LATIN-1 fonts that GS comes with & uses do not contain the Arabic character set. Thus, you might need to download some Arabic postscript based fonts for GS to use.
HTH
Regards ... Chris
Morning Guys
I have a really weird one. I have an application that when saving DWs with Saveas PDF! On Windows 10 is changing the default printer to the Sybase DW printer.
I never seen this before and cannot see what might be causing it.... has anyone else had this experience?
Cheers David
Hi David;
Yes, I have encountered this before on W10 and the odd W7. What I always try to do now is reset the default printer after a SaveAs (PDF!), as follows:
String ls_printer
ls_printer = PrintGetPrinter ( )
DC/DS.SaveAs (PDF!)
PrintSetPrinter (ls_printer)
HTH
Regards ... Chris
Hi guys,
I have read the recent posts about powerbuilder and ghostscript.
I have downloaded GS v.9.20 for a windows2012 R2 installation , PB11
Anyone got GS sybase datawindow PS working on a windows 2012 R2 please ? If yes, which gs version ? Any manual changes to perform to make this work ?
Been looking at this issue for 2 days straigth 🙁
TIA
John
We solved this. It is a setting in Windows 10 to retain the last used printer as the default. Nothing at all to do with PB or ghostscript. Change the setting in Windows 10 and it is all ok.
Cheers
David
Dear Chris,
I followed your instruction carefully:
"
1) Download and install GS 8.71 64 bit version.
2) Install GS 8.71 and make sure that you set the GS_DLL environment variable ...
ie: GS_DLL=C:\Program Files\GS\gs8.71\bin
3) Install the "Sybase DataWindow PS" printer from the GS 8.71 64 bit .INF file located in the GS install's LIB sub-folder
4) Optional: Add the GS BIN folder to your system path
5) Reboot your PC.
Now, PDF support should be working in PB 10 and higher on your 64 bit MS-Windows machines.
Note: v8.71 of GS has some key fonts that are not included in later releases of GS and these fonts are also no longer included with newer MS-Windows versions either. So what ever you do ... never delete GS 8.71 from your machine.
You can now upgrade GS as follows:
Do not uninstall GS 8.71
ie: GS_DLL=C:\Program Files\GS\gs9.01\bin (for example)
FWIW: This procedure works for me and all my clients every time! Tested with PB 10.5 through all versions to PB 12.5.2
HTH
Regards ... Chris
"
But it sill does not work, do you still have any other solution to saveas() to PDF?
I am trying : WIndows 10 or Windows 8.1 - PowerBuilder 10 - Ghostscript 8.71 and 9.21.
Please help !!!
Kim
Hi Kim;
Since I posted that procedure, GhostScript have added the missing fonts to their recent GS installations. So if you are using for example GS version 9.19 or higher - you should not need to install GS 8.71 first, nor leave old GS installations around once you are on the latest release.
HTH
Regards ... Chris
PS: As of this posting, the current version is 9.21 ... https://ghostscript.com/download/gsdnld.html