[reportlab-users] Patch for increased standard compliance of /CreationDate

Dinu Gherman gherman at darwin.in-berlin.de
Sat Sep 29 06:02:33 EDT 2007


Hi,

I noticed the /CreationDate field in the PDFInfo can be made more
standard compliant, making it have date values like this:

D:20070929113343-01'00'

instead of the current fields like:

20070929113343

This makes it easier for parsing tools to recognize the correct
date. I've attached a patched PDFDate class below (to ReportLab 2.1),
which also simplifies the __init__ method, that seemed unnecessarily
complex.

It might be worth checking if there are other places that could
benefit from that kind of improved date values, something I have
not done. But, apparenty, PDFDate is used only in pdfdoc.py:

reportlab_2_1/reportlab dinu$ grep -n PDFDate $(find . -name "*.py")
./pdfbase/pdfdoc.py:1356: D["CreationDate"] =
PDFDate(invariant=self.invariant,dateFormatter=self._dateFormatter)
./pdfbase/pdfdoc.py:1490:class PDFDate:

Regards,

Dinu
-------------- next part --------------
A non-text attachment was scrubbed...
Name: patch-pdfdoc.py
Type: application/octet-stream
Size: 1952 bytes
Desc: not available
Url : <http://two.pairlist.net/pipermail/reportlab-users/attachments/20070929/a5cc1f04/attachment.obj>
-------------- next part --------------



More information about the reportlab-users mailing list