Showing posts with label postscript. Show all posts
Showing posts with label postscript. Show all posts

Sunday, June 13, 2010

Ghostscript error?

I've been receiving the following error when attempting to compile (ps2pdf) my w5 outflows paper:

Error: /rangecheck in --get--
Operand stack:
   pdfmark   --dict:20/25(ro)(L)--   --nostringval--   50
Execution stack:
   %interp_exit   .runexec2   --nostringval--   --nostringval--   --nostringval--   2   %stopped_push   --nostringval--   --nostringval--   --nostringval--   false   1   %stopped_push   1878   1   3   %oparray_pop   1877   1   3   %oparray_pop   1861   1   3   %oparray_pop   1755   1   3   %oparray_pop   --nostringval--   %errorexec_pop   .runexec2   --nostringval--   --nostringval--   --nostringval--   2   %stopped_push   --nostringval--   %finish_show   --nostringval--   --nostringval--   8   6   1   --nostringval--   (pdf_text_enum_t)   %op_show_continue   --nostringval--
Dictionary stack:
   --dict:1153/1684(ro)(G)--   --dict:0/20(G)--   --dict:71/200(L)--   --dict:125/300(L)--   --dict:44/200(L)--   --dict:138/224(L)--
Current allocation mode is local
Last OS error: 2
Current file position is 267478928
GPL Ghostscript 8.71: Unrecoverable error, exit code 1

I get the same error with Ghostscript 8.64, but on my laptop, using the fink version, it works. Similarly, there are errors with the postscript, so I'm led to believe it's an error in latex:

$ latex --version
pdfTeX 3.1415926-1.40.10-2.2 (TeX Live 2009)
kpathsea version 5.0.0
Copyright 2009 Peter Breitenlohner (eTeX)/Han The Thanh (pdfTeX).
There is NO warranty.  Redistribution of this software is
covered by the terms of both the pdfTeX copyright and
the Lesser GNU General Public License.
For more information about these matters, see the file
named COPYING and the pdfTeX source.
Primary author of pdfTeX: Peter Breitenlohner (eTeX)/Han The Thanh (pdfTeX).
Compiled with libpng 1.2.39; using libpng 1.2.39
Compiled with zlib 1.2.3; using zlib 1.2.3
Compiled with xpdf version 3.02pl3

No idea what the cause is but it's time to start documenting steps and looking for a workaround. Compiling on the lappy isn't a good option.

Thursday, January 22, 2009

ps2pdf keep resolution, crop to bounding box

ps2pdf -dEPSCrop -dAutoRotatePages=/None -dAutoFilterColorImages=false -dColorImageFilter=/FlateEncode -dUseFlateCompression=true l007_displaycrop.ps
ref: this post

Sunday, October 12, 2008

How do I print a multi-page postscript?

I want to print a multi-page postscript duplexed and, if possible, two per page. pstopng, pstopdf, and the variants failed me horribly by making postscripts that don't fit the bounding box at all. Any ideas?

So far the best I've come up with is switching gnuplot's output to pdf, which is a workaround rather than a solution, but is useful nonetheless:
set terminal pdf enhanced dashed

Saturday, August 23, 2008

Merging postscripts

This is essential and really difficult to find answers to, but this guy gave it:
http://ludo.qix.it/archive/2005/08/merge-postscript-files.html

The keywords I would have liked to see:
"merge postscripts into multi-page document"
or "combine postscript multiple page"

e.g.
gs -sDEVICE=pswrite -sOutputFile=output.ps -dNOPAUSE -dBATCH file1.ps file2.ps file3.ps

or

gs -sDEVICE=pswrite -sOutputFile=05358spectra.ps -dNOPAUSE -dEPSFitPage -dBATCH `ls 05358_*.eps`

(the added option is to make sure the .eps isn't cropped)

Thursday, August 21, 2008

Extracting figures from papers

I want to automatically extract figures from papers, but of course most papers come in .pdf, not .ps form...

This site has a great tool for extracting figures from .ps papers:
http://www-hermes.desy.de/notes/extras/postscript.html

If anyone can tell me how to do the same thing for .pdfs (automatically extract figures from pdfs) I'd appreciate it.

Update 12/13/08: One solution is listed at http://ubuntuforums.org/showthread.php?t=884002: use pdfimages, part of the xpdf package.

Thursday, July 31, 2008

Postscript to PDF conversion

ls *.ps | sed 's/\(.*\).ps/ps2pdf \1.ps \1.pdf/' | bash

because it's impossible to view multiple postscripts in a single window.... how annoying.

Corollary:
ls *.pdf | sed 's/\(.*\).pdf/pdf2jpeg \1.pdf \1.jpg/' | bash