If you try to use gv, a great pdf file and postscript file viewer, notable for keyboard operation, on a system with unpatched ghostscript 8.71, gv will fail with something like:
<pre> Error: /undefined in copy_trailer_attrsOperand stack:
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— Dictionary stack: —dict:1159/1684(ro)(G)— —dict:1/20(G)— —dict:75/200(L)— —dict:108/127(ro)(G)— —dict:288/300(ro)(G)— —dict:21/25(L)— Current allocation mode is local Last OS error: 11 GPL Ghostscript 8.71: Unrecoverable error, exit code 1 </pre>
This is due to bugs in ghostscript 8.71.
I solved the issue by compiling ghostscript based on Sabayon Gentoo patches and guidelines. You can achieve this by:
| $ wget -c http://sumoudou.org/src/ghostscript-8.71-r4.tar.xz |
| $ tar xvf ghostscript-8.71-r4.tar.xz $ cd ghostscript-8.71-r4 $ sed -i -e 's:png_check_sig:png_sig_cmp:' base/configure.ac $ sed -i -e 's:png_check_sig:png_sig_cmp:' jbig2dec/configure.ac $ autoreconf $ cd jbig2dec $ autoreconf $ cd ijs $ autoreconf $ ./configure —disable-compile-inits —enable-dynamic —enable-fontconfig —with-driver=ALL —with-ijs —with-jbig2dec —with-libpaper $ make -j1 so all $ make -j1 install-so install |
Now gv will not fail and will display pdf files beautifully.