我想在簽名詳細資訊中顯示創建者。在“簽名是使用不可用創建的”中。

這是我添加符號資訊的代碼:
private void signDetached(SignatureInterface signature, PDDocument document, OutputStream output) throws IOException {
PDSignature pdSignature = new PDSignature();
pdSignature.setFilter(PDSignature.FILTER_ADOBE_PPKLITE);
pdSignature.setSubFilter(PDSignature.SUBFILTER_ADBE_PKCS7_DETACHED);
pdSignature.setName("jvmfy");
pdSignature.setReason("Learn how to sign pdf with jvmfy.com!");
// the signing date, needed for valid signature
pdSignature.setSignDate(Calendar.getInstance());
// register signature dictionary and sign interface
document.addSignature(pdSignature, signature);
// write incremental (only for signing purpose)
// use saveIncremental to add signature, using plain save method may break up a document
document.saveIncremental(output);
}
uj5u.com熱心網友回復:
我看著在PDF 32000規范的Prop_Build。這在 PDFBox 示例中沒有實作,在搜索“PDF 簽名構建字典規范”后,我認為這很令人困惑。但是這個嘗試是有效的,基于我在現有簽名 PDF 中看到的內容:
COSDictionary pbDict = new COSDictionary();
COSDictionary appDict = new COSDictionary();
appDict.setName(COSName.NAME, "PDFBox");
pbDict.setItem(COSName.getPDFName("App"), appDict);
pdSignature.getCOSObject().setItem(COSName.getPDFName("Prop_Build"), pbDict);
轉載請註明出處,本文鏈接:https://www.uj5u.com/qukuanlian/357559.html
