Web Connection
wwPDF using Ghostscript - no color output
Gravatar is a globally recognized avatar based on your email address. wwPDF using Ghostscript - no color output
  Mike G
  All
  Sep 18, 2018 @ 02:41pm

I have an FRX which includes jpg files at the top and bottom of the report which are in colour but when I generate the PDF using wwPDF and Ghostscript the result is always black and white.

I am using the latest version of Ghostscript. I have tried a number of the standard Xerox PS drivers.

When I generate the FRX to screen it is in colour.

Any ideas on what I might be missing please.

Gravatar is a globally recognized avatar based on your email address. re: wwPDF using Ghostscript - no color output
  Rick Strahl
  Mike Granshaw
  Sep 18, 2018 @ 09:10pm

You probably need to choose a different Postscript printer - make sure to pick a color printer to generate the PostScript file.

wwGhostScript first prints with the PostScript driver to produce the PS then converts with Ghostscript, but if the output is B&W... you get B&W.

+++ Rick ---

Gravatar is a globally recognized avatar based on your email address. re: wwPDF using Ghostscript - no color output
  Mike G
  Mike Granshaw
  Sep 18, 2018 @ 09:18pm

Yep, I have covered that already. When I open the printer properties the settings are for color. I have tried a number of different drivers.

lxpdfname="pdf\orders\OrderTEST.pdf"
wait window "Creating PDF" nowait
do wwpdf
oPDF = createobject("wwGhostScript")
oPDF.cPrinterDriver = "Xerox Phaser 6120 PS"
oPDF.cResolution = "300x300"     && optional
oPDF.cPaperSize = "a4"
llok = oPDF.PrintReport("report\poscert-jfj.Frx",lxpdfname,"for salekey='CWN0010000121053'")
if not llok
  =messagebox(oPDF.cErrorMsg,0+16)
else
  wait window "PDF save complete" timeout 3
endif

Gravatar is a globally recognized avatar based on your email address. re: wwPDF using Ghostscript - no color output
  Rick Strahl
  Mike G
  Sep 19, 2018 @ 01:06pm

I have to check but I know this has always worked for me with the Xerox PS Class Driver.

I was going to send you to the sample site but I just realized that in the recent server upgrade I didn't actually add the printer driver so that's not working at the moment - I'll get that fixed and I'll check in the process.

FWIW, you can install a printer driver with as long as you know the exact name of the printer:

console.exe INSTALLPRINTER

Another option that I just noticed is that in Windows 10 and Server 2016 (and probably Server 2012 R2 as well) we can actually use the Microsoft Print to PDF driver to directly output to PDF. I have to take a look at that as well. If that works that'll certainly be a cleaner solution that's built right into Windows.

+++ Rick ---

Gravatar is a globally recognized avatar based on your email address. re: wwPDF using Ghostscript - no color output
  Rick Strahl
  Mike G
  Sep 19, 2018 @ 07:56pm

So I spend quite a bit of time today testing a few different environments and I noticed that on my server I was having major issues with any printer that actually prints to the print spooler. Apparently Windows has changed behavior slightly and there's some Windows specific UI that pops up that causes SYS(2335,0) to detect a UI interaction and throw an error when running Web Connection in UnattendedMode in COM.

That's now fixed with some internal trickery that basically turns off unattended mode and turns it back on after printing. Yechh - but it works.

I've also created a new driver for the Microsoft Print to PDF driver which is available on Windows 10 and Windows Server 2016. This driver is self contained and other than installing as a printer in Windows Features doesn't need anything else installed. It's also considerably faster.

To make a very long story short - I was finally able to run the Ghostscript driver on my server sample here:

https://west-wind.com/wconnect/PrintPdf.wwd

Currently this uses the Microsoft driver, but it works the same with the GhostScript driver and Xerox PS Class Driver that I use by default. Both print fine in color.

Note that there may also be issues with certain image types. I think JPeg is safe, but Gif and perhaps even PNG images might not work well with the Ghostscript driver - maybe play around with that if you still have problems.

+++ Rick ---

Gravatar is a globally recognized avatar based on your email address. re: wwPDF using Ghostscript - no color output
  Mike G
  Rick Strahl
  Sep 21, 2018 @ 01:55pm

I looked for console.exe but I dont have it. The closest I have is wwClient_console.exe but that just starts the creation of a business model.

I am using the wwClient Tools. I have installed a printer using Control Panel and assigned it the Xerox Phaser 6120 PS driver. This is the driver I hand to wwpdf.

I have clients using computers ranging from XP, 7 and 10 so I need to support all. My development machine is win 7. My latest tests were using jpg but I have also tested bmp and png I know it is probably something at my end but have spent weeks trying to sort this out and have run out of places to look.

I have even installed the eval version of XFRX and changed the test to the following, but cant get past this error 'Unable to set report parameters, error code -5'

set path to data,report,lib,program lxpdfname=FULLPATH("pdf\orders\OrderTEST.pdf") wait window "Creating PDF" nowait do wwPDF oPDF = createobject("wwXFRX") llok = oPDF.PrintReport("poscert-jfj.Frx", lxpdfname, "for salekey='CWN0010000121053'") if not llok =messagebox(oPDF.cErrorMsg,0+16) else wait window "PDF save complete" timeout 3 endif

Gravatar is a globally recognized avatar based on your email address. re: wwPDF using Ghostscript - no color output
  Rick Strahl
  Mike G
  Sep 21, 2018 @ 02:02pm

Ah yes, sorry. Console.exe is part of Web Connection, but not of the client tools. For client tools you have manually install your printer.

Part of the issue may be that the printer you're installing doesn't exist on later versions of Windows - The printer list varies on all platforms and you may have to install a different printer depending on each platform.

have even installed the eval version of XFRX and changed the test to the following, but cant get past this error 'Unable to set report parameters, error code -5'

Are you using wwXFRX? It should be setting the proper parameters. If you're using XFRX directly check with the XFRX folks - Martin Haluza is very responsive to questions regarding XFRX.

+++ Rick ---

Gravatar is a globally recognized avatar based on your email address. re: wwPDF using Ghostscript - no color output
  Mike G
  Rick Strahl
  Sep 21, 2018 @ 02:19pm

I understand about the drivers for different OS, I am just trying to get it working on my win 7 machine first. I am using the Xerox Phaser 6120 PS drvier for that. Using Ghostscript it generates fine but only in greyscale.

I have been going down 2 paths, the Ghostscript one and the XFRX one to get a result either way is my goal. I will contact XFRX for help on that front, and yes I was using wwXFRX when doing that test, see previous code snippet.

Is there anything else you can think of that I can try?

Gravatar is a globally recognized avatar based on your email address. re: wwPDF using Ghostscript - no color output
  Rick Strahl
  Mike G
  Sep 21, 2018 @ 02:38pm

I only see an example using wwGhostScript not XFRX.

+++ Rick ---

Gravatar is a globally recognized avatar based on your email address. re: wwPDF using Ghostscript - no color output
  Rick Strahl
  Mike G
  Sep 21, 2018 @ 02:41pm

No I'm pretty sure that this should work, but as I said create a simple report with a simple jpeg and see if that works. My guess is that it's some image format that's not supported by the converter or the printer driver.

There might also be some setting in the report itself and its printer options? Clear the printer driver in the report itself.

+++ Rick ---

Gravatar is a globally recognized avatar based on your email address. re: wwPDF using Ghostscript - no color output
  Mike G
  Mike Granshaw
  Sep 21, 2018 @ 02:57pm

set path to data,report,lib,program lxpdfname=FULLPATH("pdf\orders\OrderTEST.pdf") wait window "Creating PDF" nowait do wwPDF oPDF = createobject("wwXFRX") llok = oPDF.PrintReport("poscert-jfj.Frx", lxpdfname, "for salekey='CWN0010000121053'") if not llok =messagebox(oPDF.cErrorMsg,0+16) else wait window "PDF save complete" timeout 3 endif Report is using a jpg file.

Gravatar is a globally recognized avatar based on your email address. re: wwPDF using Ghostscript - no color output
  Mike G
  Rick Strahl
  Sep 21, 2018 @ 03:00pm

This is the code snippet:

set path to data,report,lib,program
lxpdfname=FULLPATH("pdf\orders\OrderTEST.pdf")
wait window "Creating PDF" nowait
do wwPDF
oPDF = createobject("wwXFRX")
llok = oPDF.PrintReport("poscert-jfj.Frx", lxpdfname, "for salekey='CWN0010000121053'")
if not llok
  =messagebox(oPDF.cErrorMsg,0+16)
else
  wait window "PDF save complete" timeout 3
endif
Gravatar is a globally recognized avatar based on your email address. re: wwPDF using Ghostscript - no color output
  Mike G
  Mike G
  Sep 25, 2018 @ 10:12pm

Hi Rick, I have given up on the Ghostscript using wwpdf due to the lack of colour. Have tried numerous machins and drivers and cant make this happen. I even tried it on a clients system to rule out my computer.

I am now investigating using XFRX as it should get around the driver and OS issues. I have downloaded the demo version and installed per their instructions. I have a small program (see my previous post) but no matter what I do I still get this error message: Unable to set report paramters, error code -5

Can you please help me shed some light on this. Thanks.

Gravatar is a globally recognized avatar based on your email address. re: wwPDF using Ghostscript - no color output
  Tore Bleken
  Mike G
  Sep 25, 2018 @ 10:42pm

Make sure that "Save printer environment" is not checked in the report.

Gravatar is a globally recognized avatar based on your email address. re: wwPDF using Ghostscript - no color output
  Mike G
  Tore Bleken
  Sep 25, 2018 @ 10:49pm

Have checked that already. I cant find anywhere in the XFRX doucmentation about and error code -5 I check in wwXFRX9 and it is having issues with setting the parameters but cant see why.

Gravatar is a globally recognized avatar based on your email address. re: wwPDF using Ghostscript - no color output
  Mike G
  Mike G
  Sep 26, 2018 @ 12:30am

I have resolved this issue using XFRX. The error from XFRX was caused by an older hndlib.dll. Thanks to Rick for his help on the wwPDF end and Martina at XFRX, both providing excellent support.

© 1996-2024