[reportlab-users] Issues related to setting parameters of graphs, lines, and rectangles, and they are not printing correctly

J. R. Carroll jrcarroll at jrcresearch.net
Wed Nov 28 14:27:57 EST 2012


Thanks for the quick response Tim.

Setting the line width before drawing the rect worked.

However, I am still having the problem with the pattern-esque prints for
line widths in my grid/graph that are smaller than a unit-size of 1 (line
width of 0 just makes the pattern worse). I have strong impressions it's
not the printer because:

1. I've tried other printers and got the same results
2. I've printed another PDF that has a similar graph, and the lines are 1
dot thick (when I look at the print under a microscope)
3. I can turn up the printer settings (DPI) and get the grid to print
fully.

Do you, or does anyone else, know of a way I can make the grid/graph that I
want using the ReportLab library, rather than my homebrewed way?
(currently, I am telling it to paint to a drawing, then rendering the
drawing to the canvas - but more importantly I am drawing each line myself
- draws all the vertical minor/major lines, then draws all the horizontal
minor and major lines, then paints it to the canvas - my coworkers are
positive that ReportLab has already solved this problem).
I need the ECG strip chart to look like http://tinyurl.com/cdyre6k (it's
obvious you know what they look like, but this is for others that might not
what the result should look like).

(and yes, there is nothing proprietary about a strip chart, but the scripts
I'm writing have proprietary information so my line about "hush-hush" was
more about trying to avoid having to say "I cannot send my script out on
the web", rather than "we are making a special strip chart that's super
secret" =P)

Thanks again,




----


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
jcarroll at comiratesting.com




On Wed, Nov 28, 2012 at 12:50 PM, Tim Roberts <timr at probo.com> wrote:


> J. R. Carroll wrote:

>

> *First problem:*

>

> ***My problem:* On the screen, it looks great! When I send it to a

> printer (600 dpi, "standard" settings) it prints a pattern of lines (some

> lines are printed, and others are not) - some have suggested that this is

> the printer trying to "anti-alias" my lines because I have set my line

> widths to be .1 to .8 which is some small fraction of 1/72dpi (a line width

> of 1 is too thick for what I am doing). How can I fix this problem? My

> goal is to get minor grid lines spaced at 1 mm apart, and every 5 mm a

> major grid line, with a heavier weight (thickness? alpha?) is drawn. I

> currently have the solution scripted but again it only works on the screen,

> not at the printer.

>

>

> The advice on the forum is correct -- if you want a one-pixel line,

> regardless of output resolution, use a stroke width of 0. It's likely that

> what you're seeing here is antialiasing caused by your Acrobat reader

> stretching or shrinking your page to fit the printer boundaries. That kind

> of thing is particularly bad with non-Adobe Acrobat clones.

>

> Are you using and transforms or scaling? That adds to the problem.

>

> That's one of the things that is easy to forget with PDFs. ReportLab

> isn't actually rendering those lines. ReportLab is just writing a command

> into the PDF file that says "stroke width is 0.12, now draw a line from A

> to B". It's entirely up to the PDF reader or the PostScript interpreter in

> the printer to decide how to turn that into pixels. Not all interpreters

> agree.

>

>

>

> *Second problem:*

>

> I have drawn rectangles (as borders to my graphs), but the stroke-width

> is too thick of the rectangle. I didn't see anything in the documentation

> that allows me to set the stroke-width of a rect - any advice here? Did I

> miss it in the manual? (using canvas.Rect())

>

>

> Rectangle borders are drawn with the "stroke" and filled with the "fill".

> Set the stroke width before you call Rect, just like when you drew lines.

>

>

>

> If you need additional information or context, I'll do my best to

> provide but like all corporate projects in R&D it's pretty hush-hush (so I

> apologize if you feel I have omitted some valuable information). What I

> can say is that the graph I am trying to make is for ECG strip charts (the

> link above in problem#1 has examples of what I am talking about).

>

>

> Surely there is nothing proprietary about generating a strip chart...

>

> --

> 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/20121128/456a258a/attachment.htm>


More information about the reportlab-users mailing list