Re: deterministic output?
Andy Robinson <[email protected]>
| Newsgroups | gmane.comp.python.reportlab.user |
|---|---|
| Message-ID | <CABjtApsoxBzoMu-s-+YXSrT4ByN7NkE=y+9bNAV67JkEq54zbQ@mail.gmail.com> |
It's designed for exactly what you want; we added it so we could write regression tests many years ago. The PDF file structure contains, among other things, the time the document was created. It can also contains hashes and encodings of various parts of the content, and tables with byte offsets to other structures in the file. So, if you run the same 'hello world' script twice, you can end up with significant differences between the files. In 'invariant' mode we turn these things off and use a dummy constant timestamp, so the same script should produce identical files. - Andy On 1 November 2018 at 01:43, Chris Jerdonek <[email protected]> wrote: > Thanks, Robin. I tried a PDF with tables, and it doesn't seem to be > deterministic unless I use RL_invariant=1. What does this variable do, > and does it affect anything else? > > --Chris > On Wed, Oct 31, 2018 at 10:09 AM Robin Becker <[email protected]> wrote: >> >> >> We have done quite a lot of work to make the output deterministic, but probably you need to test the effect of environment >> variable RL_invariant=1. However I think there has been a recent change to python 3.x to make dictionaries more random which might >> make things harder. >> >> >> On 31/10/2018 16:43, Chris Jerdonek wrote: >> > Hi, >> > >> > I'm planning to write some tests of code that uses ReportLab to >> > generate some PDFs. My question is-- >> > >> > To what extent is ReportLab's PDF generation deterministic? For >> > example, will the output files be the same byte-for-byte if I generate >> > the PDF's on different platforms -- provided that the version of >> > ReportLab is the same? Are there any known gotchas? >> > >> > Thanks, >> > --Chris >> > _______________________________________________ >> > reportlab-users mailing list >> > [email protected] >> > https://pairlist2.pair.net/mailman/listinfo/reportlab-users >> > >> >> >> -- >> Robin Becker > _______________________________________________ > reportlab-users mailing list > [email protected] > https://pairlist2.pair.net/mailman/listinfo/reportlab-users -- Andy Robinson Managing Director, ReportLab Wimbletech Zone 2 35 Wimbledon Hill Road London SW19 7NB, UK Tel +44-20-8191-7277