[reportlab-users] Image from string instead of a disk file

Andy Robinson andy at reportlab.com
Tue Jun 3 17:42:41 EDT 2014


Hi Jack,


The first thing to do is to work out whether the game is worth the
candle.   Do you actually have evidence that the images and disk I/O
are the bottleneck?  e.g. If you just leave the images out of the
document, does it go fast enough for you?

If a file is accessed frequently from a local disk, like a logo or
banner, the disk head doesn't really move, because every modern OS and
indeed a lot of hard drives have some cache and end up returning
things, and read times can end up very similar to memory.  This was
true even 14 years ago when we started ReportLab.   But if you are
making PDFs that contain unique scanned images, or if it's a network
drive, the disk access might be a factor.

I am fairly sure that you can pass in a file-like object such as a
StringIO containing your image almost anywhere where you can use a
filename.

If you are interested in a few hours of commercial support, we would
be happy to review code and see what you can do to optimise things.
Drop a line to enquiries at reportlab.com and I will explain how it
works.  We're in London but can assist tomorrow.  Usually, one needs
to look at the whole document, and there is a lot we can usually do.

Best Regards,



-- 
Andy Robinson
Managing Director
ReportLab Europe Ltd.
Thornton House, Thornton Road, Wimbledon, London SW19 4NG, UK
Tel +44-20-8405-6420


More information about the reportlab-users mailing list