[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 15:21:50 EST 2012


Hmmm same results (on both printers)

But the plot thickens! (well for me it does - maybe not for you).

I have sitting next to me a strip chart done by a former coworker (not made
with reportlab; I was given it as an example to work off of) that has lines
just as fine as the ones I am working with. It's warm off the press from
the "cheaper" of the two printers - and it looks pretty good! All the
lines printed - it's a little "light" in some areas like it was photocopied
by a cheap copier, but overall it looks good. I printed his grid on the
more "expensive" (aka fancier/bigger/supposedly better) printer, and I got
a pattern-esque print with his, just like on mine. Note, that all the
printers are set to 600dpi, and the only way I can get your grid and my
grid to work is if I turn up the DPI (currently, I have only tested "CAD
Design", which is just a preset that turns it up to 1200dpi I believe).

My boss is supremely confident that ReportLab would have already had a
solution to making strip charts apart from me making my own lines (and I
agree with him - this seems like a common task). Not to completely change
directions from this phantom chase, but is there perhaps an alternative
solution to making these grids that I haven't already considered? From
what I read, it looks like "grid()" has preset parameters (grid size), so
it's not meant for this purpose (aka I couldn't tell it to major/minor
lines, but I could print two grids on top of each other). And
reportlab.charts comes with a lot of bells & whistles, and I just want the
grid. Any thoughts in this department? If this is the best way, then let
the chase continue!

Thanks again Tim, it's very nice to talk with someone who has used
ReportLab recently as I've been alone on this project from the beginning!

-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 Wed, Nov 28, 2012 at 2:55 PM, Tim Roberts <timr at probo.com> wrote:


> J. R. Carroll wrote:

> >

> > 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?

>

> Can you send me a code sample and/or a PDF that demonstrates the problem?

>

>

> > (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).

>

> This looks OK for me on my 600-dpi printer. What do you see?

>

> <code>

> import os

> from reportlab.pdfgen import canvas

> from reportlab.lib.pagesizes import LETTER

> from reportlab.lib.units import inch, mm

>

> DEBUG=1

>

> canv = canvas.Canvas( 'stripchart.pdf', pagesize=LETTER )

> canv.setPageCompression( 0 )

> canv.setLineJoin(1)

> canv.setLineCap(1)

> canv.setLineWidth(0)

> canv.setStrokeColor( (1.0, 0.8, 0.8) )

>

> # Draw a few inches in the middle.

>

> X0 = 3*inch

> Y0 = 8*inch

> X1 = X0 + 41*mm

> Y1 = Y0 + 41*mm

>

> for i in range(41):

> if i % 5 == 0:

> canv.setLineWidth( 0.5 )

> else:

> canv.setLineWidth( 0 )

> canv.line( X0, Y0+i*mm, X0+40*mm, Y0+i*mm )

> canv.line( X0+i*mm, Y0, X0+i*mm, Y0+40*mm )

> canv.showPage()

> canv.save()

>

> if DEBUG:

> os.system('start stripchart.pdf')

> </code>

>

>

> --

> 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/ea5cd032/attachment.html>


More information about the reportlab-users mailing list