[reportlab-users] Invariant support for documents

Andy Robinson reportlab-users@reportlab.com
Sun, 2 Feb 2003 08:58:40 -0000


I just added a new feature to allow "invariant" PDF documents.
'invariant' my be set in the Canvas or DocTemplate constructors,
or in rl_config globally.  Allowed values are 1, 0 or None
which means 'let the next layer down decide'. The ultimate
default in is rl_config and is set to 0 to keep current
behaviour.

If you run the same script repeatedly you normally DON'T get 
the same PDF document out (e.g. test_hello.py -> test_hello.pdf')
because PDF documents are supposed to contain their creation
time and a randomized unique document ID.  In fct, because the
latter is a binary string in which non-Ascii characters get
escaped, you don't even get the same length of file.

If you specify 'invariant' then you should get the same
file - at least if you stick with the same reportlab, PIL
if applicable and Python version :-).  

This will allow us to test if, for example, a COM wrapper
around our library outputs the same test file as the normal
script.  I do not yet promise invariance across operating
systems but that would obviously be nice so we could
do post-intall checks on installed systems easily.
Test feedback on this is most welcome :-)

- Andy