We are using aspose-pdf java to check if a PDF document contains a signature. Since version 24.5 this does not work any more. PdfFileSignature.getSignNames() returns an empty list instead of the sign names. It worked fine until version 24.4 and does not work using 24.5, 24.6 and 24.7.
See code snippet and attached project containing a PDF with signature for testing.
package org.example;
import com.aspose.pdf.facades.PdfFileSignature;
import java.util.List;
public class ReadSignatureNames {
public static void main(String[] args) {
PdfFileSignature pdfFileSignature = new PdfFileSignature();
pdfFileSignature.bindPdf(ReadSignatureNames.class.getResourceAsStream("/signed.pdf"));
List<String> sigNames = pdfFileSignature.getSignNames();
if (sigNames.isEmpty()) {
System.out.println("No signature found");
} else {
sigNames.forEach(System.out::println);
}
}
}
pdf-signature.zip (48.7 KB)