🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: comp.lang.postscript
1 messages
1 total messages Started by Adam Hoover Tue, 03 Nov 1992 20:28
HELP! WHAT IS WRONG WITH THIS PS CODE?
#4001
Author: Adam Hoover
Date: Tue, 03 Nov 1992 20:28
92 lines
3008 bytes
What is wrong with this PS (encapsulated?) code?


========================== CODE BEGINS HERE
====================================

%%BeginDocument: /home/figment/student/hoover/papers/opus/COLOR/c.2.fseg.eps

gsave

/inch {72 mul} def
143 144 scale
/buffer 1 string def
/rgbmap 36 string def

/onepixel 3 string store
/drawcolormappedimage {
  143 144 8
  [143 0 0 -144 0 144]
  %% define a block of code to read and decode the rle input stream
  { currentfile buffer readhexstring pop pop  %% index
    rgbmap buffer 0 get 3 mul 3 getinterval   %% color bytes
  }
  false 3 colorimage
} bind def

currentfile rgbmap readhexstring pop pop
ffffff
000000
ffff00
00ff00
ffff3f
ff0000
3fff3f
ff3f3f
0000ff
3f3fff
00ffff
3fffff

drawcolormappedimage
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000

========================== SKIP TO END OF DATA ================================

010101010101010101010101010101010101010101010101010101010101
010101010101010101010101%

grestore
showpage
%%EndDocument

========================== CODE ENDS HERE ====================================





If context helps, I am using psfig includes in a LaTeX document to
bring in color images.  The color images are created using xgrabsc,
and are supposed to be color, encapsulated postscript.  After creating
a final PS document using LaTeX, I am trying to use ghostview (gs) to
view it (the PS document).  It can display a page until it gets to
the _END_ of the first color image on the page. (Note that greyscale
images work fine, even if on the same page as color images.)
As soon as gs gets to the end of the first color image on the page, I get:

Error: /invalidrestore in --restore--
Operand stack:
   
(\377\377\377\000\000\000\377\377\000\000\377\000\377\377?\377\000\000?\
\377?\377??\000\000\377??\377\000\377\377?\377\377)  true  -savetype-
Execution stack:
    %interp_exit    --nostringval--  --nostringval--  false 
--nostringval--  --nostringval--  --nostringval--
Dictionary stack:
    427/449  6/200  120/200



PLEASE HELP.  ANY INFO WOULD BE EXTREMELY APPRECIATED, AS I KNOW VERY
LITTLE ABOUT POSTSCRIPT.

EMAIL or POSTS is fine.  If I get a lot of help, I will post a summary.


			Thanks in advance,
			Adam Hoover
			University of South Florida
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads