[reportlab-users] Lines Print Wrong?

Tim Roberts reportlab-users@reportlab.com
Mon, 04 Aug 2003 09:44:24 -0700

I saw an unusual thing this week using ReportLab.  I don't believe the 
problem was actually in ReportLab, but I wanted to see if it was familiar to 

I need to embed a 3x4" street map on a registration form.  For debugging, I 
created the map in a separate Python module printing to a full page so I 
could debug and adjust it more easily.  I used my own virtual coordinate 
system so that the streets lined up on 1x1 unit grid, and then did my own 
scaling (ax+b, cy+d) every time I touched the canvas.  The scaling was 
roughly 15 points per unit.

This worked, and I could print the map either standalone or embedded in my 
form.  After a while, I realized I could let Postscript do the scaling for me 
and simplify my code.  So, I eliminated my scaling, and used canvas.transform 
to do the 15:1 upscale for the full page, and about 3.5:1 for the embedded 

After I did that, both the standalone and embedded versions of the map looked 
100% correct in Acrobat, but when I printed the embedded version, all of my 
lines suddenly became about 16 points wide.  I tried it on two different 
printers (both HP PCL) with the same results: screen preview fine (even when 
zoomed), printed version bogus.  Yes, I remembered to change the 
setStrokeWidth calls to compensate for the new scaling; the stroke width was 
0.15 units, which was about 1/2 point for the embedded version.  As I said, 
the preview was exactly right.

While playing with this, as an experiement, I tried multiplying all of my 
coordinates and sizes by 10 and adjusting the transform correspondingly.  
Poof, problem went away.

My GUESS is that Acrobat's GDI conversion is missing a line width setting 
somewhere based on some edge condition.  Anyone ever seen this kind of thing 

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