/** * Gets the total number of revisions this document has. * * @return the total number of revisions */ public int getTotalRevisions() { getSignatureNames(); return this.totalRevisions; }
/** * Gets the total number of revisions this document has. * * @return the total number of revisions */ public int getTotalRevisions() { getSignatureNames(); return this.totalRevisions; }
/** * Gets the total number of revisions this document has. * * @return the total number of revisions */ public int getTotalRevisions() { getSignatureNames(); return this.totalRevisions; }
/** * Gets this <CODE>field</CODE> revision. * * @param field the signature field name * @return the revision or zero if it's not a signature field */ public int getRevision(String field) { getSignatureNames(); field = getTranslatedFieldName(field); if (!sigNames.containsKey(field)) return 0; return ((int[])sigNames.get(field))[1]; }
/** * Gets this <CODE>field</CODE> revision. * * @param field the signature field name * @return the revision or zero if it's not a signature field */ public int getRevision(String field) { getSignatureNames(); field = getTranslatedFieldName(field); if (!sigNames.containsKey(field)) return 0; return ((int[])sigNames.get(field))[1]; }
/** * Gets this <CODE>field</CODE> revision. * * @param field the signature field name * @return the revision or zero if it's not a signature field */ public int getRevision(String field) { getSignatureNames(); field = getTranslatedFieldName(field); if (!sigNames.containsKey(field)) { return 0; } return sigNames.get(field)[1]; }
/** * Checks is the signature covers the entire document or just part of it. * * @param name the signature field name * @return <CODE>true</CODE> if the signature covers the entire document, * <CODE>false</CODE> otherwise */ public boolean signatureCoversWholeDocument(String name) { getSignatureNames(); name = getTranslatedFieldName(name); if (!sigNames.containsKey(name)) return false; return ((int[])sigNames.get(name))[0] == reader.getFileLength(); }
/** * Checks is the signature covers the entire document or just part of it. * * @param name the signature field name * @return <CODE>true</CODE> if the signature covers the entire document, * <CODE>false</CODE> otherwise */ public boolean signatureCoversWholeDocument(String name) { getSignatureNames(); name = getTranslatedFieldName(name); if (!sigNames.containsKey(name)) return false; return ((int[])sigNames.get(name))[0] == reader.getFileLength(); }
/** * Checks is the signature covers the entire document or just part of it. * * @param name the signature field name * @return <CODE>true</CODE> if the signature covers the entire document, * <CODE>false</CODE> otherwise */ public boolean signatureCoversWholeDocument(String name) { getSignatureNames(); name = getTranslatedFieldName(name); if (!sigNames.containsKey(name)) { return false; } return sigNames.get(name)[0] == reader.getFileLength(); }
/** * Gets the field names that have blank signatures. * * @return the field names that have blank signatures */ public ArrayList getBlankSignatureNames() { getSignatureNames(); ArrayList sigs = new ArrayList(); for (Iterator it = fields.entrySet().iterator(); it.hasNext();) { Map.Entry entry = (Map.Entry)it.next(); Item item = (Item)entry.getValue(); PdfDictionary merged = item.getMerged(0); if (!PdfName.SIG.equals(merged.getAsName(PdfName.FT))) continue; if (sigNames.containsKey(entry.getKey())) continue; sigs.add(entry.getKey()); } return sigs; }
/** * Gets the field names that have blank signatures. * * @return the field names that have blank signatures */ public ArrayList getBlankSignatureNames() { getSignatureNames(); ArrayList sigs = new ArrayList(); for (Iterator it = fields.entrySet().iterator(); it.hasNext();) { Map.Entry entry = (Map.Entry)it.next(); Item item = (Item)entry.getValue(); PdfDictionary merged = item.getMerged(0); if (!PdfName.SIG.equals(merged.getAsName(PdfName.FT))) continue; if (sigNames.containsKey(entry.getKey())) continue; sigs.add(entry.getKey()); } return sigs; }
/** * Gets the field names that have blank signatures. * * @return the field names that have blank signatures */ public ArrayList getBlankSignatureNames() { getSignatureNames(); ArrayList sigs = new ArrayList(); for (Iterator it = fields.entrySet().iterator(); it.hasNext(); ) { Map.Entry entry = (Map.Entry) it.next(); Item item = (Item) entry.getValue(); PdfDictionary merged = item.getMerged(0); if (!PdfName.SIG.equals(merged.getAsName(PdfName.FT))) { continue; } if (sigNames.containsKey(entry.getKey())) { continue; } sigs.add(entry.getKey()); } return sigs; }
/** * Gets the signature dictionary, the one keyed by /V. * * @param name the field name * @return the signature dictionary keyed by /V or <CODE>null</CODE> if the field is not * a signature */ public PdfDictionary getSignatureDictionary(String name) { getSignatureNames(); name = getTranslatedFieldName(name); if (!sigNames.containsKey(name)) return null; Item item = (Item)fields.get(name); PdfDictionary merged = item.getMerged(0); return merged.getAsDict(PdfName.V); }
/** * Gets the signature dictionary, the one keyed by /V. * * @param name the field name * @return the signature dictionary keyed by /V or <CODE>null</CODE> if the field is not a signature */ public PdfDictionary getSignatureDictionary(String name) { getSignatureNames(); name = getTranslatedFieldName(name); if (!sigNames.containsKey(name)) { return null; } Item item = fields.get(name); PdfDictionary merged = item.getMerged(0); return merged.getAsDict(PdfName.V); }
/** * Gets the signature dictionary, the one keyed by /V. * * @param name the field name * @return the signature dictionary keyed by /V or <CODE>null</CODE> if the field is not * a signature */ public PdfDictionary getSignatureDictionary(String name) { getSignatureNames(); name = getTranslatedFieldName(name); if (!sigNames.containsKey(name)) return null; Item item = (Item)fields.get(name); PdfDictionary merged = item.getMerged(0); return merged.getAsDict(PdfName.V); }
/** * Extracts a revision from the document. * * @param field the signature field name * @return an <CODE>InputStream</CODE> covering the revision. Returns <CODE>null</CODE> if * it's not a signature field * @throws IOException on error */ public InputStream extractRevision(String field) throws IOException { getSignatureNames(); field = getTranslatedFieldName(field); if (!sigNames.containsKey(field)) return null; int length = ((int[])sigNames.get(field))[0]; RandomAccessFileOrArray raf = reader.getSafeFile(); raf.reOpen(); raf.seek(0); return new RevisionStream(raf, length); }
/** * Extracts a revision from the document. * * @param field the signature field name * @return an <CODE>InputStream</CODE> covering the revision. Returns <CODE>null</CODE> if * it's not a signature field * @throws IOException on error */ public InputStream extractRevision(String field) throws IOException { getSignatureNames(); field = getTranslatedFieldName(field); if (!sigNames.containsKey(field)) return null; int length = ((int[])sigNames.get(field))[0]; RandomAccessFileOrArray raf = reader.getSafeFile(); raf.reOpen(); raf.seek(0); return new RevisionStream(raf, length); }
/** * Extracts a revision from the document. * * @param field the signature field name * @return an <CODE>InputStream</CODE> covering the revision. Returns <CODE>null</CODE> if it's not a signature field * @throws IOException on error */ public InputStream extractRevision(String field) throws IOException { getSignatureNames(); field = getTranslatedFieldName(field); if (!sigNames.containsKey(field)) { return null; } int length = sigNames.get(field)[0]; RandomAccessFileOrArray raf = reader.getSafeFile(); raf.reOpen(); raf.seek(0); return new RevisionStream(raf, length); }