[reportlab-users] Tried reportlab on python 3.4... failed
Glenn Linderman
v+python at g.nevcal.com
Tue Oct 28 01:05:42 EDT 2014
On 10/27/2014 12:27 PM, Glenn Linderman wrote:
> On 10/26/2014 11:18 AM, Marius Gedminas wrote:
>> On Sat, Oct 25, 2014 at 11:07:39PM -0700, Glenn Linderman wrote:
>>> On 10/25/2014 7:16 PM, Andy Robinson wrote:
>>> On Python 2 you get 412/150*72 == 144, which fits in the 186-point
>>> frame.
And 144pt == 2in, and the image I was actually printing came out 2in
wide, which was not what I wanted, but I didn't measure it until now.
>>> Maybe that is in mm? Hmm.
>>> Nope. 2.75" == 69.85mm. Ah, maybe points... 2.75" = 198pt. Unless you use a
>>> point size other than 72/inch.
>> PDF points are 1/72 inch, yes.
>>
>>> Anyway this is pretty close. Assuming 186.0
>>> is in the same units... that would be 2.58333"... the difference being about
>>> 12 points or 6 points a side if it is some sort of padding or margin, which
>>> seems likely, since it has affected both height and width calculations.
OK, it seems that 6pt is the default padding for a Frame, and
SimpleDocTemplate must create Frames with default padding... so that
explains the 186pt limit reported in the error message.
There doesn't seem to be a way to override that... except by using
BaseDocTemplate... or by making the margins 6pt smaller to compensate
for the Frame padding.
OK, now my Python 3 version of the code produces what I really wanted in
the first place, and I've learned more, but perhaps if the user guide is
redone, some of these issues might be mentioned and explained, rather
than being surprises or discoveries.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://pairlist2.pair.net/pipermail/reportlab-users/attachments/20141027/5896c446/attachment-0001.html>
More information about the reportlab-users
mailing list