cancel
Showing results for 
Search instead for 
Did you mean: 

PowerBuilder 12.5 Classic GhostScript creating blank pdf

Former Member
0 Kudos
1,854

I am using window 7 x32. PowerBuilder 12.5 Classic and GhostScript 9.1w32

I am trying to update an old script (written in PB8) which used to use a Jaguar server to generate PDF documents, but for whatever reason that is no longer supported/working with PB12.5.

I have installed GhostScript 9.1 and the registry HKLM\SOFTWARE\GPL Ghostscript\9.1\GS_DLL points to gsdll32.dll and I have a Sybase DataWindow PS printer available

The PB Code I am using to generate the PDF is:

lstr_pdf_props.s_string[1] = "filename.pdf"

...

dw_statement.Object.DataWindow.Export.PDF.Method = Distill! dw_statement.Object.DataWindow.Export.PDF.Distill.CustomPostScript="No"

dw_statement.SaveAs(lstr_pdf_props.s_string[1], PDF!, false)

This completes without error and creates a C:\filename.pdf file 3kb in size, however it is a blank page, the file opens in adobe reader but there is no writing or anything printed, just a blank white page.

Does anyone have any ides as to what might be going on here?

thanks.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Might be the version of ghostscript. See this post from stackovervlow.

http://stackoverflow.com/questions/15853014/powerbuilder-12-5-classic-pdf-saveas-creating-files-of-0...

Former Member
0 Kudos

Hi Brad,

I did actually see that post in my research.

I have also tried to use the suggested 8.71 version of GhostScript. and it kept coming up with the same results.

I actually just found my own solution.

What I did was remove the Sybase DataWindow PS Printer and added a new printer using the built in adobe pdf driver, then renamed it to Sybase DataWindow PS. re-ran the application and bam! now it creates pdf documents with content.

There are still a few things I am required to iron out with it (for example I need to add Title and Author properties on the pdf file) but having the content there is definitely a good start.

Thanks for your response. It is good to know there is still an active support forum out there for PB.

Former Member
0 Kudos

Hi JA;

  FWIW: That was and still IS your problem ... the "Sybase DataWindow PS" Printer definition.

You should have installed this printer from the .INF file supplied with GhostScript and no where else!

Have a look in GS's "LIB" sub-folder for the installation file. Also ... make sure that you only use the 32bit GS on W7 32bit and the 64bit GS on W7 64bit based PC's.

Regards ... Chris

former_member190719
Active Contributor
0 Kudos

What I did was remove the Sybase DataWindow PS Printer and added a new printer using the built in adobe pdf driver, 

Do you mean the Adobe postscript drivers?  If so, I've done the same as I get better results with them than with the ones that Sybase provided (I believe those came from Microsoft).

Former Member
0 Kudos

Hi Bruce,

Under Add a printer, I selected FILE: (Print to File). Then on the driver page: Adobe > Adobe PDF Converter.

Its either built into windows or installed with office I think.

I would suggest using the GhostScript Driver as Chris suggested. (same method but select Have Disk at the driver screen, then browse to the .inf) The only downside to that I guess is it is not Digitally Signed, so depending on the environment you may not be able to install it.

Former Member
0 Kudos

WOW! I swapped to the GS print driver as you suggested and not only does it work but the PDFs being generated went from around 50-60kb in size to 4-5kb.

Now, is there a way I can tell it to print multiple DataWindows into the one PDF?

thanks.

former_member190719
Active Contributor
0 Kudos

Definately not built into Windows.  I have Office 2007 Professional installed at home and I don't have it.  I do have it installed on my office machine, which has Office 2007 Small Business on it, but it didn't seem to come with Office.  I'm guessing Dell provided it as pre-installed software.

Former Member
0 Kudos

LOL ... Yes, the GS printer driver is not only more efficient in generating PDF's but a lot faster too!  

Tip1: Don't forget to keep current with the GS releases as this printer driver has been updated to not only work more efficiently in generating PDF files but also render them better as well.

Tip2: For those using W7/W8 64 bit ... once you have GS working with release 8.71 (which resolves missing fonts) - do not delete this GS release as the font mappings will disappear as well! However, you can install newer GS releases on top of v8.71 and replace the "Sybase DataWindow PS" Printer definition from the newer GS releases.

Former Member
0 Kudos

well... I actually got it to work

by installing the 64 bit version

as opposed to the 32 bit

Answers (1)

Answers (1)

Former Member
0 Kudos

This all works flawlessly if you use the right version of GhostScript.

For Win8.1, use the Ghostscript Download  at www.ghostscript.com/downlo0ad/gsdnld.html

This driver has been digitally signed, so no need to go through the unsigned driver install process.

I tested this with PB 12.6, Win 8.1 (64 bit), and Ghostscript 9.19 for Windows (64 bit)

Former Member
0 Kudos

FYI: The proper download URL is actually .... Ghostscript: Ghostscript Downloads

Former Member
0 Kudos

I just installed GS 9.19 64bit on a Windows 7 Enterprise PC that has never had any version of GS on it. I installed Sybase DataWindow PS using the inf from the GS installation.

I have PowerBuilder 10.5 and it does not work. I tried copying gswin64.exe to gswin32.exe but that doesn't help. I even tried adding the ...\bin folder to the system path. Still no luck.

arnd_schmidt
Active Contributor
0 Kudos

AFAIK old PowerBuilder 10.5 is looking for gswin32c.exe.

hth

Arnd

Former Member
0 Kudos

http://forums.asp.net/t/755349.aspx?Printing+from+web+server

The .DLLs are named the same so it seems like it should work.  Be sure to name the printer "Sybase Datawindow PS".  There is a fairly detailed troubleshooting guide in the older PB help docs.  The first thing to do is try the "Save As" from within the PB datawindow.  If that works, try your app.

If running a web service, web app, or service, be sure to check out my posting above.