undefinedresource on ghostscript

TL;DR: Use ghostscript 9.05 instead of newer versions to use dvipdf

Today, I was trying to compile a DVI file with dvipdf, but I get this error:

Error: /undefinedresource in resourcestatus
Operand stack:
false ct_StyleDicts --dict:0/4(L)-- Adobe-Japan1 --dict:0/4(L)-- Serif HeiseiMin-W3-83pv-RKSJ-H Font HeiseiMin-W3 CIDFont
Execution stack:
%interp_exit .runexec2 --nostringval-- --nostringval-- --nostringval-- 2 %stopped_push --nostringval-- --nostringval-- --nostringval-- false 1 %stopped_push 1967 1 3 %oparray_pop 1966 1 3 %oparray_pop 1950 1 3 %oparray_pop 1836 1 3 %oparray_pop --nostringval-- %errorexec_pop .runexec2 --nostringval-- --nostringval-- --nostringval-- 2 %stopped_push --nostringval-- --nostringval-- --nostringval-- 1915 10 11 %oparray_pop
Dictionary stack:
--dict:1185/1684(ro)(G)-- --dict:0/20(G)-- --dict:85/200(L)-- --dict:124/300(L)-- --dict:60/200(L)-- --dict:57/75(L)-- --dict:2/10(L)-- --dict:39/70(L)-- --dict:0/4(L)-- --dict:0/4(L)-- --dict:20/27(ro)(G)-- --dict:20/26(ro)(G)--
Current allocation mode is local
Last OS error: No such file or directory
GPL Ghostscript 9.15: Unrecoverable error, exit code 1

After trying to figure out what just happen, I remember that this DVI was correctly renderred on other PC, using ghostscript (GS) 9.05. So, in order to solve this issue, you need to install a previous version of GS. In this case, I will use 9.05:

1. Download http://downloads.ghostscript.com/public/ghostscript-9.05.tar.gz
2. Extract and install

tar xzvf ghostscript-9.05.tar.gz
cd ghostscript-9.05
./configure
make
sudo make install

In order to check  the GS version, type man gs and go to the end of the man pages. You should see 9.05 in the bottom of the man pages.

As far as I know, this issue is due to the EPS images in your document. In my case, I have used two EPS formats (you can check it using file image.eps command on linux):


1 Fig3.eps: PostScript document text conforming DSC level 3.0, type EPS
2 Fig4.eps: DOS EPS Binary File Postscript starts at byte 32 length 255343 TIFF starts at byte 255375 length 27871

Previous versions of GS can handle both EPS formats. However, newer version can handle only the first format.

More info:
stackoverflow

Deja un comentario