[reportlab-users] Custom Flowables - Can't get shapes.Drawing() to paint to the story/canvas
J. R. Carroll
jrcarroll at jrcresearch.net
Thu Nov 29 23:30:24 EST 2012
Well, the issue of making a flowable from Drawing never came to fruition,
but I'll tackle it later. Until then I wrestled the script into submission.
It's freely available to anyone who might make use of it - the script.zip
also has a sample PDF of what it generates. If new colors are added or you
want to create a new PDF you can just rerun the script itself; I'm sure
others have created similar solutions, or this was an odd way of
approaching the problem of the printer/pdf grid lines, but it was a really
fun side-project that allowed me to learn some additional ReportLab
features!
But our company will be using this PDF/script to look/debug printers in the
future. Our intent is to look at the grayscale, color, and on-the-screen
PDF to decide which colors will work for our purposes.
I'll respond to my other thread, so at least it gets documented - this
is regarding the printing issue with the strip chart (where it was printing
some grid lines and not others) as I have my final conclusions on the
entire mess.
If anyone has solutions on how to optimize it I'm all ears - I'm new to
reportlab so I'd love to hear some feedback.
You can download the script from here:
http://www.jrcresearch.net/downloads/scripts.zip
Thanks again for your help Tim!
-J
----
J. R. Carroll
Independent Researcher through Hurtz Labs
Research Methods, Test Development, and Statistics
www.jrcresearch.net
Cell: (650) 776-6613
Email: jrcarroll at jrcresearch.net
jrcarroll at hurtzlab.com
jrc.csus at gmail.com
On Thu, Nov 29, 2012 at 12:23 PM, Tim Roberts <timr at probo.com> wrote:
> 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.
>
> _______________________________________________
> reportlab-users mailing list
> reportlab-users at lists2.reportlab.com
> http://two.pairlist.net/mailman/listinfo/reportlab-users
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://two.pairlist.net/pipermail/reportlab-users/attachments/20121129/bab1925e/attachment.html>
More information about the reportlab-users
mailing list