当我使用Reportlab创建pdf时,如何更改元数据字段,CreationDate和ModificationDate?
Take a look在哪里设置了修改和创建日期:
D['ModDate'] = D["CreationDate"] = \
Date(ts=document._timeStamp,dateFormatter=self._dateFormatter)
# ...
return PDFDictionary(D).format(document)
基本上,元数据是保存在二进制字符串末尾的字典,字符串的开头是文件内容(document
)。
在Reportlab内部,您询问的工作流程可以是:
document
PDFDictionary
并创建日期PDFDictionary
格式化文档