Topic: Query about ghostscript for Centos 6 with php5.6

I am getting
**** Warning:  File has an invalid xref entry:  15.  Rebuilding xref table.

   **** This file had errors that were repaired or ignored.
   **** The file was produced by:
   **** >>>> Mac OS X 10.12.5 Quartz PDFContext <<<<
   **** Please notify the author of the software that produced this
   **** file that it does not conform to Adobe's published PDF
   **** specification.

When converting some PDFs using Imagick.. I think this is a ghostscript bug - and doesn't happen on my other machine  running ghostscript 9.70.

Is there an easy alternative where I can install a more modern ghostscript for use along with your Imagick6  libraries? There seems to be no reasonable RPMS out there to do this.

Failing that I guess I can install ghostscript from source  which seems to work for some people - but this will have to be in /usr/local I suspect because of the dependencies. What do I have to do to link this with your distributions? Do you have any suggestions about how to deal with this problem?

Thanks as usual.

Re: Query about ghostscript for Centos 6 with php5.6

Sorry, no simple answer to this issue sad

Desktop: Fedora 25 x86_64 + rpmfusion + remi-test + remi-dev
Laptop:  Fedora 26 x86_64 + remi (SCL only)
Hosting Server: CentOS 6.9 x86_64 + EPEL + remi + remi-php70

Re: Query about ghostscript for Centos 6 with php5.6

Well it looks as if Imagick uses /usr/bin/gs. So I've tried installing the new version and symlinking /usr/bin/gs to /usr/local/bin/gs. I guess care will be needed if a new Ghostscript version emerges from upstream, but this seems to fix it.

Do you see any problems with this?

Re: Query about ghostscript for Centos 6 with php5.6

> Well it looks as if Imagick uses /usr/bin/gs

Indeed, gs version is too old to use the library on EL-6 (which is used on EL-7 and Fedora)

> Do you see any problems with this?

Should be ok

BTW, probably worth to report a bug against ghostscript on http://bugzilla.redhat.com/ with a PDF sample

Desktop: Fedora 25 x86_64 + rpmfusion + remi-test + remi-dev
Laptop:  Fedora 26 x86_64 + remi (SCL only)
Hosting Server: CentOS 6.9 x86_64 + EPEL + remi + remi-php70

Re: Query about ghostscript for Centos 6 with php5.6

Well this is Centos... and it's using your code... so they may not believe me - or care given the life expectancy of the system - and I don't really own the source PDF.

It looks as if /etc/ImageMagick6/ImageMagick-6/delegates.xml is the place which forks to gs.
If I change this file to change 'gs' to '/usr/local/bin/gs - will it be zapped by a new update? - or will it get the rpmnew treatment?

Gut feeling says that the newer version of gs is faster. BTW.

Re: Query about ghostscript for Centos 6 with php5.6

# rpm --query --configfiles ImageMagick6-libs
...
/etc/ImageMagick6/ImageMagick-6/delegates.xml
...

This is a configuration file, so won't be overriden by new update.

Desktop: Fedora 25 x86_64 + rpmfusion + remi-test + remi-dev
Laptop:  Fedora 26 x86_64 + remi (SCL only)
Hosting Server: CentOS 6.9 x86_64 + EPEL + remi + remi-php70

Re: Query about ghostscript for Centos 6 with php5.6

Great - well doing that works - and seems to wrap things up nicely. Thanks for your assistance as usual.