LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 12-13-2014, 08:01 AM   #1
denydias
Member
 
Registered: Dec 2013
Distribution: Slackware
Posts: 296

Rep: Reputation: Disabled
Question Ghostscript (or Postscript?) error


Hi all,

I'm working on a project where I need to programmatically convert a lot of PDF files to TIFF. A fast and reliable tool for this is Ghostscript. But I'm facing troubles with it.

Here is the command line I'm using for the job:

Code:
$ gs -q -dSAFER -dBATCH -dNOPAUSE -r300x300 -sDEVICE=tifflzw -sOutputFile=out-%06d.tif inputfile.pdf
As one can see, I'm converting a PDF file to TIFF with an output resolution of 300dpi, 1bit color (B&W) and LZW compression. This is a requirement for the project.

When I run the above line on Slackware, I get this:

Code:
Unrecoverable error: undefined in .getdeviceparams
Operand stack:
    --nostringval--  --nostringval--
Now, when I run it under Ubuntu (>12.04) it work just fine. It also works on Slackware when I change the device to -sDEVICE=tiffgray, but this gives me an 8bit color file, which breaks the project specification.

I've already look around the net and can't find anything that help me to solve this out. That's why I'm asking for the Slackware experts here.

Does anyone out there have faced something similar? Is this a Ghostscript or Postscript error? Is there any know solution for this under Slackware?

Bellow are some debug info about GS. The Slackware it's running on is a -current multilib.

Code:
$ gs
GPL Ghostscript 9.07 (2013-02-14)
Copyright (C) 2012 Artifex Software, Inc.  All rights reserved.
This software comes with NO WARRANTY: see the file PUBLIC for details.
GS>devicenames ==
[... /tifflzw ...]
Let me know if I can provide any piece of information from this system.

I thank you very much in advance for any relevant information.
 
Old 12-13-2014, 12:27 PM   #2
dwblas
Member
 
Registered: Jun 2011
Posts: 87

Rep: Reputation: Disabled
Don't know what you have or have not looked at, or if you are converting images that are originally color or black and white, but Imagemagick/convert is the usual way to convert images. It seems, to me at least, that you will have to set the parameters yourself as far as what is black and what is white, as you can not expect a default value to know what you want. Start with the -threshold option and see if that works for you. You may have to go through pages of Imagemagick docs to get it to do what you want but I don't see an alternative.
 
Old 12-13-2014, 01:18 PM   #3
mancha
Member
 
Registered: Aug 2012
Posts: 484

Rep: Reputation: Disabled
Quote:
Originally Posted by denydias View Post
Is this a Ghostscript or Postscript error? Is there any know solution for this under Slackware?
Hi.

I reproduced on my 14.1 system. Turns out to be a bug in Ghostscript (missing initializers in tifflzw & tiffpack).

Solution: Re-build Ghostscript 9.07 after applying: ghostscript-9.07_tifflzw_pack.diff

--mancha

Last edited by mancha; 12-14-2014 at 03:32 AM.
 
2 members found this post helpful.
Old 12-15-2014, 10:57 PM   #4
denydias
Member
 
Registered: Dec 2013
Distribution: Slackware
Posts: 296

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by dwblas View Post
Imagemagick/convert is the usual way to convert images.
Indeed. But PDF is a language and Ghostscript has a much better performance over ImageMagick for this particular task. gs is almost 7x quicker and takes less than a half of the memory usage when compared to convert. In a large scale application, this is serious figures.

Quote:
Originally Posted by mancha View Post
I reproduced on my 14.1 system. Turns out to be a bug in Ghostscript (missing initializers in tifflzw & tiffpack).

Solution: Re-build Ghostscript 9.07 after applying: ghostscript-9.07_tifflzw_pack.diff
Thank you for the test and confirm the bug, mancha! I gave a try on your diff and it indeed work.

At the end I'm going to use another device, tiffg4. This one works out without a glitch with the standard packages (ghostscript-9.07-x86_64-2 and libtiff-3.9.7-x86_64-1).
 
  


Reply

Tags
conversion, ghostscript, pdf, postscript, tiff



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Error installing ghostscript viewer shivkiyer Linux - Software 2 07-11-2007 01:46 AM
Error in ghostscript proton666 *BSD 1 12-13-2004 05:08 PM
Ghostscript 8.14 stackunderflow error on linux tcma Linux - Software 0 10-22-2004 01:56 PM
Postscript error when printing with OpenOffice spuzzzzzzz Linux - Software 6 03-22-2004 05:38 AM
CUPS printer ghostscript error! cexshun Linux - Hardware 1 02-13-2003 06:31 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 01:49 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration