[reportlab-users] Anybody else hungry for Image shapes?

Andy Robinson reportlab-users@reportlab.com
Thu, 1 Aug 2002 01:12:56 +0100


> Since you aren't dependent on any rasterising, bitmaps and picmaps are
> a subset of the things you need a name for.  If you forget, for a
> moment, the contents of the Image, are you left with what are usually
> called 'figures', 'diagrams' or 'plates' in books?  When we were
> typesetting books, we called all of these things 'regions' and
> sometimes 'rectangular regions' -- or 'keeps' if the important thing
> to remember about the wretched thing was that you could not split them
> over a page.  Some authors wanted their keep exactly where it followed
> logically in their argument -- and if that meant that one page was 
> mostly blank, so be it.  Others wanted the keep to show up 'the
> next time you have enough room for it' which was sometimes tricky.
> 
> Laura Creighton


Two separate copnversations going on here.  I better weigh
in before newbies get confused!

(1) The conversation taking place was about the class name for
a very particular thing we are adding: a raster image within one 
of our vector diagrams. The reportlab.graphics subpackage
deals with Drawing objects which contain descendants of
Shape classes.  Some people want to include (and maybe distort) 
bitmaps (GIF, PNG, JPEG, whatever) alongside the bezier curves,
rectangles and other primitive vector shapes.  We just thought
that maybe Image was a bad name as it would get confused
with PIL Images (especially as they are so damned similar,
both basically handles to bitmaps).

(2) I think what you are talking about is covered elsewhere in
our reportlab.platypus model - things within a story which might
be diagrams, charts, or bitmaps.  In our framework those
aee all "Flowable Object" descendants in the "story". Just
to make it more mind-bending, Drawing instances are Flowables
and can thus appear anywhere in a document or a table cell;
but unlike other document content, they can be directly
rendered as a GIF or PNG or SVG.

When you write a flowable object, you can implement a split()
method if you want, and if you don't then it cannot split
over a page.  Right now everything appears inline within
the story.  If you want smarter formatting logic, you
have to g#figure out the rulkes and hook into the
numeroud methods of the DocTemplate, to respond to the
beginning or end of a page or frame with any special
instructions you have.  There's no magic to say "fit this
in next time you have room for it".  

regards,

Andy