Author Topic: Migrating from native Ghostscript to RPM packaged one...  (Read 15751 times)

Dariusz Piatkowski

  • Hero Member
  • *****
  • Posts: 1317
  • Karma: +26/-0
    • View Profile
Migrating from native Ghostscript to RPM packaged one...
« on: March 25, 2017, 10:38:38 pm »
I have been using native GSView and Ghostscript for a number of years now. Even though Lucide has come along nicely I still experience pretty regular printing issues with it (see http://trac.netlabs.org/lucide/ticket/342)...so I rely on Ghostveiw/script to always come through with a good hard-copy output.

The current working setup is made up of:

1) GSView 5.0 (2012-01-07 release)
2) Ghostscript 9.04

I installed the current RPM package of Ghostscript, that being 9.18. I then modified the setups in GSView so re-point it to the RPM version of the install.

1) Working setup of GSView
"Ghostscript DLL:"
=> G:\APPS\GENERAL\GSTOOLS\gs9.04\bin\gsdll2.dll

"Ghostscript Include Path: "
=> g:\apps\general\gstools\gs9.04\resource\Init;G:\apps\general\gstools\gs9.04\lib;g:\apps\general\gstools\gs9.04\resource\Font;g:\psfonts;

"Ghostscript Options:"
=> -dNOPLATFONTS -sFONTPATH="g:\psfonts;g:\apps\general\gstools\gs9.04\resource\Font"

2) NEW setups of GSView
"Ghostscript DLL:"
=> G:\usr\lib\gsdll2.dll

"Ghostscript Include Path: "
=> G:\usr\share\ghostscript\9.18\resource\init;G:\usr\share\ghostscript\9.18\lib;G:\usr\share\ghostscript\9.18\iccprofiles;

"Ghostscript Options:"
=> -dNOPLATFONTS -sFONTPATH="g:\psfonts;G:\usr\share\fonts\default\ghostscript;G:\usr\share\fonts\default\type1"

This gave me a working display of the PDF, meaning, GSview has no problems properly rendering the PDF files. The only issue I actually have is the ability to print. Specifically, any attempt to do so produces the following error message:

=== START ===
GPL Ghostscript 9.18 (2015-10-05)
Copyright (C) 2015 Artifex Software, Inc.  All rights reserved.
This software comes with NO WARRANTY: see the file PUBLIC for details.
Unknown device: pswrite
  ./base/gsicc_manage.c:1086: gsicc_open_search(): Could not find default_gray.icc
| ./base/gsicc_manage.c:1706: gsicc_set_device_profile(): cannot find device profile
Unrecoverable error: unknownerror in .special_op
Operand stack:
    defaultdevice
Unrecoverable error: undefined in .uninstallpagedevice
Operand stack:
    defaultdevice
gsapi_exit returns 0
DosFreeModule returns 12
=== STOP ===

Because of the message above (...could not find default_gray.icc...) I included the matching directory in the Include Path setup, that being: "G:\usr\share\ghostscript\9.18\iccprofiles;". Still, this has had no impact, the error remains.

So I'm curious how have others proceeded in this migration step? Have you completely un-installed Ghostview? Have you made any other changes?

Thanks as always!

Andi B.

  • Hero Member
  • *****
  • Posts: 811
  • Karma: +11/-2
    • View Profile
Re: Migrating from native Ghostscript to RPM packaged one...
« Reply #1 on: March 26, 2017, 01:53:34 pm »
I've -
Quote
"Ghostscript DLL:"
=> G:\usr\lib\gsdll2.dll
p:/usr/lib/gsdll2.dll

Quote
"Ghostscript Include Path: "
=> G:\usr\share\ghostscript\9.18\resource\init;G:\usr\share\ghostscript\9.18\lib;G:\usr\share\ghostscript\9.18\iccprofiles;
p:/usr/lib

Quote
"Ghostscript Options:"
=> -dNOPLATFONTS -sFONTPATH="g:\psfonts;G:\usr\share\fonts\default\ghostscript;G:\usr\share\fonts\default\type1"
-dNOPLATFONTS -sFONTPATH="m:/psfonts;p:/usr/share/fonts/default/Type1"

M: is my boot drive, P: is my %UNIXROOT%

I'm pretty sure printing worked some times ago but now I get the same error message than you. Time to fill an issue I think.

Btw. at least font path may need slash instead back slash.

ivan

  • Hero Member
  • *****
  • Posts: 1558
  • Karma: +17/-0
    • View Profile
Re: Migrating from native Ghostscript to RPM packaged one...
« Reply #2 on: March 26, 2017, 10:47:27 pm »
I have just had a look at this thinking I might be able to update our systems.

I unpacked the RPM and had a look at the files to see if they could be transferred to the standard gs directory structure.  They can, but, as usual there are other DLLs required. 

Now I need to find jpeg.dll, lcms22.dll, cupsim.dll and cupc.dll.  I assume the last two are to help with integration into cups printing but the question is which versions of all those.

Maybe you need to check if you have those DLLs in your libpath. 
« Last Edit: March 26, 2017, 10:50:24 pm by ivan »

Dariusz Piatkowski

  • Hero Member
  • *****
  • Posts: 1317
  • Karma: +26/-0
    • View Profile
Re: Migrating from native Ghostscript to RPM packaged one...
« Reply #3 on: March 27, 2017, 04:56:01 am »
Hi Andi,

...I'm pretty sure printing worked some times ago but now I get the same error message than you. Time to fill an issue I think.

Btw. at least font path may need slash instead back slash.

I tried your settings, no difference. This includes the fwd-slash instead of back-slash.

Dariusz Piatkowski

  • Hero Member
  • *****
  • Posts: 1317
  • Karma: +26/-0
    • View Profile
Re: Migrating from native Ghostscript to RPM packaged one...
« Reply #4 on: March 27, 2017, 04:59:31 am »
Hi ivan,

...Now I need to find jpeg.dll, lcms22.dll, cupsim.dll and cupc.dll.  I assume the last two are to help with integration into cups printing but the question is which versions of all those.

Maybe you need to check if you have those DLLs in your libpath.

I find all but one of the DLLs you listed in my \usr\lib path, which is the target DLL path for RPM installer on my system. Only the cupc.dll is missing.

If I remember correctly, the cups-libs RPM package was installed along with the ghostscript RPM package. As well, the ghostscript-fonts RPM was another pre-requisite.

Dave Yeo

  • Hero Member
  • *****
  • Posts: 4787
  • Karma: +99/-1
    • View Profile
Re: Migrating from native Ghostscript to RPM packaged one...
« Reply #5 on: March 27, 2017, 05:55:39 am »
I can't find cupsc.dll on an ArcaOS instal either, seems to have all the other cups and ghostscript stuff.

ak120

  • Guest
Re: Migrating from native Ghostscript to RPM packaged one...
« Reply #6 on: March 27, 2017, 11:56:35 pm »
It's quite possible that colour maps are totally broken the same way as generation of printer lists in the latest RPM packages. When installing gs-9.18 to naked system there's a directory "\usr\share\ghostscript\9.10\Resource\CMap" created from package poppler-data-0.4.7-1.oc00.noarch with some kind of links to required files. The directory "\usr\share\ghostscript\9.18\Resource\CMap" from gs-9.18 is empty.

ak120

  • Guest
Re: Migrating from native Ghostscript to RPM packaged one...
« Reply #7 on: March 28, 2017, 01:46:18 am »
Rozwiązanie rosyjski:

1. Skopiuj plik z \usr\lib\gsdll2.dll do \usr\bin
2. Start programu GVPM.EXE
3. Wybierz z menu "Options" - "Easy Configure"
4. Dalej - Katalog X:\USR !!! - dalej ... do końca
5. Nowy plik o nazwie PRINTERS.INI została wygenerowana / i ewentualnie \OS2\GVPM.INI
6. Restart GVPM - Otwórz plik PDF - Druk - Lista urządzeń zawiera teraz ps2write

Powodzenia! Przepraszam za mój katastrofalnej języka polskiego.

Dariusz Piatkowski

  • Hero Member
  • *****
  • Posts: 1317
  • Karma: +26/-0
    • View Profile
Re: Migrating from native Ghostscript to RPM packaged one...
« Reply #8 on: March 28, 2017, 05:10:16 am »
Hi Andreas!

Rozwiązanie rosyjski:

1. Skopiuj plik z \usr\lib\gsdll2.dll do \usr\bin
2. Start programu GVPM.EXE
3. Wybierz z menu "Options" - "Easy Configure"
4. Dalej - Katalog X:\USR !!! - dalej ... do końca
5. Nowy plik o nazwie PRINTERS.INI została wygenerowana / i ewentualnie \OS2\GVPM.INI
6. Restart GVPM - Otwórz plik PDF - Druk - Lista urządzeń zawiera teraz ps2write

Powodzenia! Przepraszam za mój katastrofalnej języka polskiego.

Wow my friend...that is SUPERB!!!

So the only - shall we say - un-clear step is #4, as it literally translates to:

"4. Further - Catalog X:\user !!! - further...until the end"

...and try as hard as I did...I just couldn't make sense of it...hmmm....???

Anyways, I tried this, however the "Easy Configure" always ended up in a FAIL...and the GVPM.INI itself was never re-written.

I did take a stab at that file manually, modified the following 'GhostscriptEXE' section, since adjusting it from within GSView (using the Advanced Config option) did not make any changes:

OLD
===
[GSview-5.0]
Configured=1
GSversion=910
Version=5.0
GhostscriptDLL=G:\usr\lib\gsdll2.dll
GhostscriptEXE=G:\APPS\GENERAL\GSTOOLS\gs9.04\bin\gsos2.exe
GhostscriptInclude=G:\usr\share\ghostscript\9.18\resource\init;G:\usr\share\ghostscript\9.18\lib;G:\usr\share\ghostscript\9.18\iccprofiles
GhostscriptOther=-dNOPLATFONTS -sFONTPATH="g:\psfonts;G:\usr\share\fonts\default\ghostscript;G:\usr\share\fonts\default\type1"

NEW
===

[GSview-5.0]
Configured=1
GSversion=910
Version=5.0
GhostscriptDLL=G:\usr\lib\gsdll2.dll
GhostscriptEXE=G:\usr\bin\gsos2.exe
GhostscriptInclude=G:\usr\share\ghostscript\9.18\resource\init;G:\usr\share\ghostscript\9.18\lib;G:\usr\share\ghostscript\9.18\iccprofiles
GhostscriptOther=-dNOPLATFONTS -sFONTPATH="g:\psfonts;G:\usr\share\fonts\default\ghostscript;G:\usr\share\fonts\default\type1"

...unfortunately, even with the corrected path to the gsos2.exe file it still failed to print.

Andi B.

  • Hero Member
  • *****
  • Posts: 811
  • Karma: +11/-2
    • View Profile
Re: Migrating from native Ghostscript to RPM packaged one...
« Reply #9 on: March 28, 2017, 08:26:00 am »
Printing problem is cause psprint is not upported anymore by GS. See tickets at netlabs and Pauls Mantis. Ps2printer should be used intead. But at least for me it does not work. Someone who is willing to work on GSView/GSVPM is needed...

roberto

  • Hero Member
  • *****
  • Posts: 810
  • Karma: +3/-6
    • View Profile
Re: Migrating from native Ghostscript to RPM packaged one...
« Reply #10 on: March 28, 2017, 09:11:03 am »
I do not in Gsview, but in lucide I install poppler-legacy-63 ver 0.47.0-1  for a correct print
Sorry, the poppler-legacy-63 is for plugins in lucide, not for print. The last poppler-legacy-65 fail in plugins with lucide.
« Last Edit: March 28, 2017, 06:06:07 pm by roberto »

ak120

  • Guest
Re: Migrating from native Ghostscript to RPM packaged one...
« Reply #11 on: March 28, 2017, 12:11:59 pm »
So the only - shall we say - un-clear step is #4, as it literally translates to:

"4. Further - Catalog X:\user !!! - further...until the end"

...and try as hard as I did...I just couldn't make sense of it...hmmm....???

Anyways, I tried this, however the "Easy Configure" always ended up in a FAIL...and the GVPM.INI itself was never re-written.

Simply put "X:\usr" to the upper entry field (second dialogue) for "In which directory...". With X for your specific drive letter. No other modifications are required. The Easy configure routine will add "bin" to it internally. Thats crucial to get the device list in printer.ini rebuilt.

Dariusz Piatkowski

  • Hero Member
  • *****
  • Posts: 1317
  • Karma: +26/-0
    • View Profile
Re: Migrating from native Ghostscript to RPM packaged one...
« Reply #12 on: April 02, 2017, 03:44:37 am »
Well you guys...after several hrs of trying all sorts of things, reviewing some of the older ticket on Paul's site (Mantis), etc, etc...I come to the conclusion that Andi did, namely: GSView is the culprit as the newer ghostscript releases no longer support 'pswrite'.

Sooo...I suppose given that I continue to have Lucide printing problems I will take a stab at the GSView source...no idea how complex (or not) it is...but maybe i can decipher it??? lol

Dariusz Piatkowski

  • Hero Member
  • *****
  • Posts: 1317
  • Karma: +26/-0
    • View Profile
Re: Migrating from native Ghostscript to RPM packaged one...
« Reply #13 on: April 02, 2017, 04:01:18 pm »
So guys...I looked at the source, granted, just preliminary stuff, but given what I see I conclude that I must be missing something because the change seems literally trivial, help me out please.

Here is a section of the code, which as best as I can tell sets up the output device, it is identified with the following comments:

/* gvcprn.c */
/* Printer module of PM and Windows GSview */

=== START ===
...
    if (convert) {
   device = option.convert_device;
   resolution = option.convert_resolution;
    }
    else if (method == PRINT_GDI) {
   switch (option.print_gdi_depth) {
       case IDC_COLOUR:
      device = "bmp16m";
      break;
       case IDC_GREY:
      device = "bmpgray";
      break;
       default:
      device = "bmpmono";
      break;
   }
   resolution = "300";   /* fix later */
    }
    else if (method == PRINT_PS) {
   device = "pswrite";
   resolution = "600";   /* a guess */
    }
    else {
   device = option.printer_device;
   resolution = option.printer_resolution;
    }
...
=== STOP ===

See that reference to 'pswrite' when the print method is set to PRINT_PS (I assume PostScript printer selection)?

I will simply change that to 'ps2write', re-compile and report back on the results...seems just too easy though, no???

Pete

  • Hero Member
  • *****
  • Posts: 1281
  • Karma: +9/-0
    • View Profile
Re: Migrating from native Ghostscript to RPM packaged one...
« Reply #14 on: April 03, 2017, 02:53:15 am »
Hi All

Thought I'd seen something about pswrite somewhere. From the gs9.15 readme:-

4) GSView requires manual changes to the Ghostscript Include statement
(Options->Advanced Configuration) - I used
'c:\gs\gs9.15\resource\init;C:\GS\gs9.15\lib;C:\GS\gs9.15\Resource\font;C:\GS\fonts;c:\psfonts;'
to make it work
5) the pswrite device that GSView uses to print has been removed from
Ghostscript 9.x. To print using ghostview, modify x:\os2\gvpm.ini and replace
all cases of pswrite with ps2write


Regards

Pete