Aspose.PDF for Java PdfFileSignature remove signature content

Look at this picture,I wana to remove two things,“Date”,and another one “Digitally sigend by…”,How to remove it?

image.png (28.2 KB)

image.png (28.2 KB)

@zulin

Is it added as valid signatures in the PDF? You can use below code snippet to remove the signatures from a PDF document:

public static void RemoveSignature() {
        // Create PdfFileSignature object
        PdfFileSignature pdfSign = new PdfFileSignature();
        // Open PDF document
        pdfSign.bindPdf(_dataDir + "DigitallySign.pdf");
        // Get list of signature names
        List<String> sigNames = pdfSign.getSignNames();
        // Remove all the signatures from the PDF file
        for (int index = 0; index < sigNames.size(); index++) {
            System.out.println("Removed " + sigNames.get(index));
            pdfSign.removeSignature(sigNames.get(index));
        }
        // Save updated PDF file
        pdfSign.save(_dataDir + "RemoveSignature_out.pdf");
    }

ref: Remove Signature from PDF File|Aspose.PDF for Java

thanks very much brother, I will to try your code and give you my feedback

Hi my brother,thanks very much again!
I’ve modified your code and added a code to remove some of the default property values

PKCS7 pkcs = new PKCS7(pfxPath, pfxPassword); // Use PKCS7
pkcs.setShowProperties(false);


It work,I success

@zulin

It is nice to know that you were able to resolve your issue. Please keep using the API and feel free to let us know in case you need further assistance.

Thank you very much, this is glad to solve some problems