[reportlab-users] Error with EPS (3.0) Graphic

Bernard Cagalj reportlab-users@reportlab.com
Wed, 29 Sep 2004 15:09:10 +0200


Hallo !

when I try to generate a PDF document with embedded *.eps (3.0) graphic

(Code example):

<illustration width="300" height="300">
 <image file="logo.eps" x="0" y="0" width="300" height="300"/>
</illustration>

I get the following error:

IMPACTSLOX:/srv/www/htdocs/pdf # trml2pdf ./ex10.rml > ./impact.pdf
Error: /undefined in
Operand stack:

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:1057/1417(ro)(G)--   --dict:0/20(G)--   --dict:99/200(L)--
Current allocation mode is local
ESP Ghostscript 7.05.3: Unrecoverable error, exit code 1
Traceback (most recent call last):
  File "/usr/bin/trml2pdf", line 530, in ?
    print parseString(file(sys.argv[1], 'r').read())
  File "/usr/bin/trml2pdf", line 518, in parseString
    r.render(fp)
  File "/usr/bin/trml2pdf", line 148, in render
    pt_obj.render(self.dom.documentElement.getElementsByTagName('story')[0])
  File "/usr/bin/trml2pdf", line 507, in render
    self.doc_tmpl.build(fis)
  File "/usr/lib/python2.2/site-packages/reportlab/platypus/doctemplate.py",
line 631, in build
    self.handle_flowable(flowables)
  File "/usr/lib/python2.2/site-packages/reportlab/platypus/doctemplate.py",
line 549, in handle_flowable
    if self.frame.add(f, self.canv, trySplit=self.allowSplitting):
  File "/usr/lib/python2.2/site-packages/reportlab/platypus/frames.py", line
135, in _add
    flowable.drawOn(canv, self._x + self._leftExtraIndent, y,
_sW=self._getAvailableWidth()-w)
  File "/usr/lib/python2.2/site-packages/reportlab/platypus/flowables.py",
line 98, in drawOn
    self._drawOn(canvas)
  File "/usr/lib/python2.2/site-packages/reportlab/platypus/flowables.py",
line 83, in _drawOn
    self.draw()#this is the bit you overload
  File "/usr/bin/trml2pdf", line 410, in draw
    drw.render(self.canv, None)
  File "/usr/bin/trml2pdf", line 338, in render
    cnv.render(self.node)
  File "/usr/bin/trml2pdf", line 326, in render
    tags[tag](nd)
  File "/usr/bin/trml2pdf", line 274, in _image
    self.canvas.drawImage(img, **args)
  File "/usr/lib/python2.2/site-packages/reportlab/pdfgen/canvas.py", line
586, in drawImage
    rawdata = image.getRGBData()
  File "/usr/lib/python2.2/site-packages/reportlab/lib/utils.py", line 351,
in getRGBData
    rgb = self._image.convert('RGB')
  File "//usr/lib/python2.2/site-packages/PIL/Image.py", line 439, in
convert
    self.load()
  File "//usr/lib/python2.2/site-packages/PIL/EpsImagePlugin.py", line 279,
in load
    self.im = Ghostscript(self.tile, self.size, self.fp)
  File "//usr/lib/python2.2/site-packages/PIL/EpsImagePlugin.py", line 75,
in Ghostscript
    im = Image.core.open_ppm(file)
IOError: error when accessing file

Can anybody help !? Thank you in forward

Greetings
Bernard