[reportlab-users] Custom Flowables - Can't get shapes.Drawing() to paint to the story/canvas

Tim Roberts timr at probo.com
Thu Nov 29 15:23:04 EST 2012


J. R. Carroll wrote:

> Funny as you sent this, I got so frustrated trying to making a custom

> flowable, I reverted my code back to a stage where I am doing exactly

> as you suggest.

>

> I suppose I was trying to build in more flexibility with the script so

> that way if I changed the dimensions (say from Letter to A4) it would

> still work - that way other people can use this script besides me!

>

> Any thoughts on how to account changing the page size and controlling

> the placement of the grids+grid labels?


Depends on what look you are after. Typically, I either want stuff
placed at some fixed interval from the page edge (like one inch), or I
want stuff placed at some fixed percentage of the width (like starting
at 25% across). Both of those things are easy to accomplish.

I will often have a global at the top to hold the page size:
pagesize = letter
Then, I can pass that to the canvas.Canvas constructor, and I still have
pagesize[0] as the width and pagesize[1] as the height. That way, I can
even do landscape:
pagesize = landscape(letter)

--
Tim Roberts, timr at probo.com
Providenza & Boekelheide, Inc.



More information about the reportlab-users mailing list