On this page
Guides
Remove Digital Signatures
You can easily remove a digital signature, and when you do so, both the appearance and data associated with the signature will be deleted.
It's important to note that removing a signature does not remove the signature field.
This example shows how to remove digital signatures:
java
// Remove digital signature.
CPDFDocument document = new CPDFDocument();
document.open(FileUtils.getAssetsTempFile("Signed.pdf"));
for (int i = 0; i < document.getSignatureCount(); i++) {
CPDFSignature signature = document.getPdfSignature(i);
if (i == 0){
// Remove first digital signature.
boolean result = document.removeSignature(signature, document, true);
if (result) {
System.out.println("remove signature success");
}else {
System.out.println("remove signature fail");
}
}
}
document.save(rootDir + "/out/signatureTest.pdf", CPDFDocument.PDFDocumentSaveType.PDFDocumentSaveNoIncremental);