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.
// You can choose if you want to remove the appearance.
CPDFDocument document = new CPDFDocument(context);
document.open(FileUtils.getAssetsTempFile(context, "Signed.pdf"));
for (int i = 0; i < document.getSignatureCount(); i++) {
CPDFSignature signature = document.getPdfSignature(i);
if (i == 0){
// Remove first digital signature.
document.removeSignature(signature, true, (signatureWidget) -> {
readerView.refreshSignatureWidget(signatureWidget);
});
}
}
document.save();
kotlin
// Remove digital signature.
// You can choose if you want to remove the appearance.
val document = CPDFDocument(context)
document.open(FileUtils.getAssetsTempFile(context, "Signed.pdf"))
for (i in 0 until document.signatureCount) {
val signature = document.getPdfSignature(i)
if (i == 0) {
// Remove first digital signature.
document.removeSignature(signature, true) { signatureWidget->
readerView.refreshSignatureWidget(signatureWidget)
}
}
}
document.save()