即时通讯使用iText将xhtml转换为pdf。之后,我正在构建生成的pdf的md5校验和以仅存储新的/更改的文件。删除PDF中的PDF
每个创建的文件都包含一个看起来像散列的PdfID0和PdfID1。
这些“哈希”是什么?我该如何删除它们?使用PDFTK
com.lowagie.text.pdf.PdfReader reader = new PdfReader(pdfPath);
com.lowagie.text.pdf.PdfStamper stamper = new PdfStamper(reader, new FileOutputStream(tempFile));
HashMap<String, String> hMap = reader.getInfo();
hMap.put("Title", "MyTitle");
hMap.put("Subject", "Subject");
hMap.put("Keywords", "Key, words, here");
hMap.put("Creator", "me");
hMap.put("Author", "me");
hMap.put("Producer", "me");
hMap.put("CreationDate", null);
hMap.put("ModDate", null);
hMap.put("DocChecksum", null);
stamper.setMoreInfo(hMap);
stamper.close();
和提取的文件METAS:
IM使用下面的代码从iText的包装改变metainfos
InfoKey: Creator
InfoValue: me
InfoKey: Title
InfoValue: MyTitle
InfoKey: Author
InfoValue: me
InfoKey: Producer
InfoValue: me
InfoKey: Keywords
InfoValue: Key, words, here
InfoKey: Subject
InfoValue: Subject
PdfID0: 28c71a8d7790a4d3e85ce879a90dec0
PdfID1: 4c5865d36c7a381e6166d5e362d0aafc
NumberOfPages: 1
感谢任何提示
我在生成SHA1和时具有与这些ID完全相同的问题。你有没有想过如何去除/规范化这个问题,或者你知道下面的信息后就放弃了吗? – mlissner