[reportlab-users] SVG for canvas.drawInlineImage

Arkadi Colson arkadi at smartbit.be
Thu Jan 13 07:46:32 EST 2022


Hi

Thanks for the answer! I'm using this already for svg images inside 
Flowables and that is working perfectly but inside the canvas method it 
trows an error:

   File 
"/usr/local/lib/python2.7/dist-packages/reportlab/pdfgen/canvas.py", 
line 852, in drawInlineImage
     img_obj = PDFImage(image, x,y, width, height)
   File 
"/usr/local/lib/python2.7/dist-packages/reportlab/pdfgen/pdfimages.py", 
line 40, in __init__
     self.getImageData()
   File 
"/usr/local/lib/python2.7/dist-packages/reportlab/pdfgen/pdfimages.py", 
line 165, in getImageData
     imagedata, imgwidth, imgheight = self.PIL_imagedata()
   File 
"/usr/local/lib/python2.7/dist-packages/reportlab/pdfgen/pdfimages.py", 
line 91, in PIL_imagedata
     if image.format=='JPEG':
AttributeError: Drawing instance has no attribute 'format'

Best regards
Arkadi Colson

On 13/01/2022 13:38, Dinu Gherman wrote:
> WAARSCHUWING: Deze mail is afkomstig van buiten Smartbit. Klik niet op links en open geen bijlagen, tenzij je deze mail verwacht en hij afkomstig is van een betrouwbare bron.
>
> Maybe https://github.com/deeplook/svglib is an option for you?
>
> Cheers,
> Dinu
>
> 13.01.2022 13:16:58 Arkadi Colson <arkadi at smartbit.be>:
>
>> Hi
>>
>> Is there a way to use an svg-image for canvas.drawInlineImage?
>>
>> Thx
>> Arkadi
>>
>> _______________________________________________
>> reportlab-users mailing list
>> reportlab-users at lists2.reportlab.com
>> https://pairlist2.pair.net/mailman/listinfo/reportlab-users


More information about the reportlab-users mailing list