[Image-SIG] PIL: Saving as pdf gives Key error

Fredrik Lundh fredrik@pythonware.com
Wed, 14 Apr 1999 17:32:37 +0200


> I'm running the 1.0b1 release of Pil on windows NT.  I can open images
> of various formats, but I'm having trouble saving as pdf.  I get a Key
> error when Image.py makes the call:
> 
>    SAVE[string.upper(format)](self, fp, filename)
> 
> KeyError: PDF
> 
> Any ideas what's going on?

works for me.  the following will show you if
all drivers are correctly loaded:

>>> import Image
>>> Image.init()
>>> Image.SAVE.keys()
['PNG', 'PDF', 'IM', 'PPM', 'BMP', 'GIF', 'XBM', 'MSP', 'JPEG', 'EPS', 'DES', 'TIFF']

if you don't get the same results, your installation
is broken.

...

btw, I just noticed that the PDF driver doesn't work
for "L" images.  "/DctDecode" should be "/DCTDecode".
might be problems with "RGB" and "CMYK" images too
-- I'll fix that in 1.0 final.

Cheers /F
fredrik@pythonware.com
http://www.pythonware.com