[reportlab-users] [ANN] PyCanvas, the return of the revenge of the mission !

Robin Becker reportlab-users@reportlab.com
Wed, 2 Oct 2002 16:01:57 +0100


In article <20021002094927.GA2595@port50-2.unice.fr>, Jerome Alet
<alet@unice.fr> writes
>Hi,
>
>the attached gzipped pycanvas.py v0.5 might be of mucho
>interest when debugging :
>
>  it generates well commented source code, and tracks important 
>data like page numbers, numbers PDFPathObjects and PDFTextObjects
>as well as forms, and puts the saveState/restoreState nesting
>level and dictionnary values in the comments !
>
>I sincerely hope you'll enjoy this.
>
>bye,
>
>Jerome (now maybe I will do something else) Alet
Jerome, as you noted this gives somewhat different results when using
the accelerator and without. First off the rounding isn't the same. It
uses relative rounding to reduce storage. 

Thus
pyfp_str(.3333349) ==> '0.333335'
fp_str(1000.3333349) ==> '.333335'

but

pyfp_str(1000.3333349) ==> '1000.333335'
fp_str(1000.3333349) ==> '1000.333'


This is probably ok, but I'm happy to change to using a fixed format
(with cleaning).

Internally Adobe used and perhaps still does a 16.16 binary format
anyway so all our numbers should probably be rounded to the nearest
model number, but that would lead to our outputting some strange things
eg the smallest non-zero positive value is 0.00001525878906
-- 
Robin Becker