Java Code Examples for com.lowagie.text.pdf.PdfReader#getAcroFields()

The following examples show how to use com.lowagie.text.pdf.PdfReader#getAcroFields() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ITextPDFSignatureService.java    From dss with GNU Lesser General Public License v2.1 5 votes vote down vote up
private PdfDictionary findExistingSignature(PdfReader reader, String signatureFieldId) {
	AcroFields acroFields = reader.getAcroFields();
	List<String> signatureNames = acroFields.getFieldNamesWithBlankSignatures();
	if (signatureNames.contains(signatureFieldId)) {
		Item item = acroFields.getFieldItem(signatureFieldId);
		return item.getMerged(0);
	}
	throw new DSSException("The signature field '" + signatureFieldId + "' does not exist.");
}
 
Example 2
Source File: ITextPDFSignatureService.java    From dss with GNU Lesser General Public License v2.1 5 votes vote down vote up
private boolean containsFilledSignature(PdfReader reader) {
	AcroFields acroFields = reader.getAcroFields();
	List<String> signatureNames = acroFields.getSignedFieldNames();
	for (String name : signatureNames) {
		PdfDict dictionary = new ITextPdfDict(acroFields.getSignatureDictionary(name));
		PdfSigDictWrapper signatureDictionary = new PdfSigDictWrapper(dictionary);
		if (Utils.isArrayNotEmpty(signatureDictionary.getContents())) {
			return true;
		}
	}
	return false;
}