[Image-SIG] Can't print or display PSDraw output.

Richard Townsend richard@starfighter.freeuk.com
Wed, 7 Nov 2001 22:58:25 -0000


When I use PSDraw() to generate postscript from an image, I can't print it
or display it in ghostview.

e.g.

import Image, PSDraw
im = Image.open('lena.gif').convert('L')
box = (1*72, 2*72, 7*72, 10*72)
outfp = open('lena.ps','w')
ps = PSDraw.PSDraw(outfp)
ps.begin_document()
ps.image(box,im,72)
ps.rectangle(box)
ps.end_document()

When I try to send 'lena.ps' it to the printer, the print job is aborted.

When I try to display it in ghostview, I get:

Error: /undefined in gsize
Operand stack:
   --nostringval--
Execution stack:
   %interp_exit
.runexec2   --nostringval--   --nostringval--   --nostringval--   2
%stopped_push   --nostringval--   --nostringval--   --nostringval--   false
1   %stopped_push   1   3   %oparray_pop   1   3   %oparray_pop
.runexec2   --nostringval--   --nostringval--   --nostringval--   2
%stopped_push   --nostringval--   --nostringval--   --nostringval--
Dictionary stack:
   --dict:994/1241(ro)(G)--   --dict:0/20(G)--   --dict:82/200(L)--
Current allocation mode is local
Last OS error: 2
Current file position is 1058
GNU Ghostscript 6.51: Unrecoverable error, exit code 1

Paint Shop Pro also complains about 'undefined in gsize'.


Is it possible to use PSdraw() to print images ?


regards
Richard Townsend