Integrate "Flowable" (SVG) with caching

"Yannick Gosteli @ PETZI" <[email protected]>
Newsgroups gmane.comp.python.reportlab.user
Message-ID <[email protected]>
Dear,

I generate a document that contains a SVG repeated several times.
I wonder if there is a way to integrate this SVG with "caching" the same 
way it works with Canvas.drawImage*.

My problem is the PDF file size blows up when I integrate a SVG dozens 
or even hundreds times.
I "abstracted" my problem here: 
https://github.com/Gostich/reportlab_test_svg/blob/master/test.py

I currently found a workaround that is not that bad by rendering my SVG 
into a PIL image and then use Canvas.drawImage.
You can check my workaroud here: 
https://github.com/Gostich/reportlab_test_svg/blob/master/test2.py

Does anybody has a better way to do that?

Best regards
Yannick

* From the reportlab userguide about Canvas.drawImage: "However, we use 
a caching system; a given image will only be stored the first time it is 
used, and just referenced on subsequent use"

-- 
Yannick Gosteli
PETZI - Association suisse des clubs de musiques actuelles
Billetterie/Petzitickets
[email protected]
www.petzi.ch - www.petzitickets.ch
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.