GroupDocs.Signature provides ImageSignature class to manipulate image signatures and delete them from the documents over delete method. Please be aware that delete method modifies the same document that was passed to constructor of Signature class, so the example below copies the signed document first and deletes the signature from the copy.
How to delete Image signature from the document
Here are the steps to delete Image signature from the document with GroupDocs.Signature:
Create new instance of Signature class and pass source document path as a constructor parameter;
Select from list ImageSignature object(s) that should be removed from the document;
Call Signature object delete method and pass one or several signatures to it; for a single signature it returns True when the signature was deleted.
This example shows how to delete Image signature that was found using search method.
The sample presentation also has a picture of its own. With skip_external set to True, the search returns only the image signatures added by GroupDocs.Signature, so that picture is never passed to delete.
importshutilfromgroupdocs.signatureimportSignaturefromgroupdocs.signature.optionsimportImageSearchOptionsdefdelete_image_signature():# delete() saves the changes into the opened document, so work on a copyshutil.copy("signed.pptx","image_signature_deleted.pptx")withSignature("image_signature_deleted.pptx")assignature:options=ImageSearchOptions()# Return only signatures added by GroupDocs.Signature, not the slide's own picturesoptions.skip_external=Truesignatures=signature.search([options]).signaturesprint(f"Found {len(signatures)} image signature(s)")ifnotsignatures:returnimage_signature=signatures[0]ifsignature.delete(image_signature):print(f"Deleted image signature at ({image_signature.left}, {image_signature.top}), "f"{image_signature.size} bytes")else:print("Image signature was not deleted")if__name__=="__main__":delete_image_signature()
signed.pptx is the sample file used in this example. Click here to download it.