@Test public void lastBytesNotCoveredTest02() throws IOException { String inPdf = sourceFolder + "lastBytesNotCoveredTest02.pdf"; PdfReader reader = new PdfReader(inPdf); AcroFields acroFields = reader.getAcroFields(); Assert.assertFalse(acroFields.signatureCoversWholeDocument("Signature1")); }
public boolean signatureCoversWholeDocument(String name) { getSignatureNames(); name = getTranslatedFieldName(name); if (!sigNames.containsKey(name)) return false; try { ContentsChecker signatureReader = new ContentsChecker(reader.getSafeFile()); return signatureReader.checkWhetherSignatureCoversWholeDocument(reader.getAcroFields().getFieldItem(name)); } catch (IOException e) { return false; } }
AcroFields { public boolean signatureCoversWholeDocument(String name) { getSignatureNames(); name = getTranslatedFieldName(name); if (!sigNames.containsKey(name)) return false; try { ContentsChecker signatureReader = new ContentsChecker(reader.getSafeFile()); return signatureReader.checkWhetherSignatureCoversWholeDocument(reader.getAcroFields().getFieldItem(name)); } catch (IOException e) { return false; } } }
AcroFields { public boolean signatureCoversWholeDocument(String name) { getSignatureNames(); name = getTranslatedFieldName(name); if (!sigNames.containsKey(name)) return false; try { ContentsChecker signatureReader = new ContentsChecker(reader.getSafeFile()); return signatureReader.checkWhetherSignatureCoversWholeDocument(reader.getAcroFields().getFieldItem(name)); } catch (IOException e) { return false; } } AcroFields(PdfReader reader, PdfWriter writer); }
AcroFields { public boolean signatureCoversWholeDocument(String name) { getSignatureNames(); name = getTranslatedFieldName(name); if (!sigNames.containsKey(name)) return false; try { ContentsChecker signatureReader = new ContentsChecker(reader.getSafeFile()); return signatureReader.checkWhetherSignatureCoversWholeDocument(reader.getAcroFields().getFieldItem(name)); } catch (IOException e) { return false; } } AcroFields(PdfReader reader, PdfWriter writer); static Object[] splitDAelements(String da); String[] getAppearanceStates(String fieldName); String[] getListOptionExport(String fieldName); String[] getListOptionDisplay(String fieldName); boolean setListOption(String fieldName, String[] exportValues, String[] displayValues); int getFieldType(String fieldName); void exportAsFdf(FdfWriter writer); boolean renameField(String oldName, String newName); void decodeGenericDictionary(PdfDictionary merged, BaseField tx); String getFieldRichValue(String name); String getField(String name); String[] getListSelection(String name); boolean setFieldProperty(String field, String name, Object value, int inst[]); boolean setFieldProperty(String field, String name, int value, int inst[]); void mergeXfaData(Node n); void setFields(FdfReader fdf); boolean regenerateField(String name); boolean setField(String name, String value); boolean setField(String name, String value, boolean saveAppearance); boolean setFieldRichValue(String name, String richValue); boolean setField(String name, String value, String display); boolean setField(String name, String value, String display, boolean saveAppearance); boolean setListSelection(String name, String[] value); Map<String, Item> getFields(); void setFields(XfdfReader xfdf); Item getFieldItem(String name); String getTranslatedFieldName(String name); List<FieldPosition> getFieldPositions(String name); boolean removeFieldsFromPage(int page); boolean removeField(String name, int page); boolean removeField(String name); boolean isGenerateAppearances(); void setGenerateAppearances(boolean generateAppearances); boolean clearSignatureField(String name); ArrayList<String> getSignatureNames(); ArrayList<String> getBlankSignatureNames(); PdfDictionary getSignatureDictionary(String name); PdfIndirectReference getNormalAppearance(String name); boolean signatureCoversWholeDocument(String name); PdfPKCS7 verifySignature(String name); PdfPKCS7 verifySignature(String name, String provider); int getTotalRevisions(); int getRevision(String field); InputStream extractRevision(String field); Map<String, TextField> getFieldCache(); void setFieldCache(Map<String, TextField> fieldCache); void setExtraMargin(float extraMarginLeft, float extraMarginTop); void addSubstitutionFont(BaseFont font); ArrayList<BaseFont> getSubstitutionFonts(); void setSubstitutionFonts(ArrayList<BaseFont> substitutionFonts); XfaForm getXfa(); void removeXfa(); PushbuttonField getNewPushbuttonFromField(String field); PushbuttonField getNewPushbuttonFromField(String field, int order); boolean replacePushbuttonField(String field, PdfFormField button); boolean replacePushbuttonField(String field, PdfFormField button, int order); boolean doesSignatureFieldExist(String name); }
AcroFields { public boolean signatureCoversWholeDocument(String name) { getSignatureNames(); name = getTranslatedFieldName(name); if (!sigNames.containsKey(name)) return false; try { ContentsChecker signatureReader = new ContentsChecker(reader.getSafeFile()); return signatureReader.checkWhetherSignatureCoversWholeDocument(reader.getAcroFields().getFieldItem(name)); } catch (IOException e) { return false; } } AcroFields(PdfReader reader, PdfWriter writer); static Object[] splitDAelements(String da); String[] getAppearanceStates(String fieldName); String[] getListOptionExport(String fieldName); String[] getListOptionDisplay(String fieldName); boolean setListOption(String fieldName, String[] exportValues, String[] displayValues); int getFieldType(String fieldName); void exportAsFdf(FdfWriter writer); boolean renameField(String oldName, String newName); void decodeGenericDictionary(PdfDictionary merged, BaseField tx); String getFieldRichValue(String name); String getField(String name); String[] getListSelection(String name); boolean setFieldProperty(String field, String name, Object value, int inst[]); boolean setFieldProperty(String field, String name, int value, int inst[]); void mergeXfaData(Node n); void setFields(FdfReader fdf); boolean regenerateField(String name); boolean setField(String name, String value); boolean setField(String name, String value, boolean saveAppearance); boolean setFieldRichValue(String name, String richValue); boolean setField(String name, String value, String display); boolean setField(String name, String value, String display, boolean saveAppearance); boolean setListSelection(String name, String[] value); Map<String, Item> getFields(); void setFields(XfdfReader xfdf); Item getFieldItem(String name); String getTranslatedFieldName(String name); List<FieldPosition> getFieldPositions(String name); boolean removeFieldsFromPage(int page); boolean removeField(String name, int page); boolean removeField(String name); boolean isGenerateAppearances(); void setGenerateAppearances(boolean generateAppearances); boolean clearSignatureField(String name); ArrayList<String> getSignatureNames(); ArrayList<String> getBlankSignatureNames(); PdfDictionary getSignatureDictionary(String name); PdfIndirectReference getNormalAppearance(String name); boolean signatureCoversWholeDocument(String name); PdfPKCS7 verifySignature(String name); PdfPKCS7 verifySignature(String name, String provider); int getTotalRevisions(); int getRevision(String field); InputStream extractRevision(String field); Map<String, TextField> getFieldCache(); void setFieldCache(Map<String, TextField> fieldCache); void setExtraMargin(float extraMarginLeft, float extraMarginTop); void addSubstitutionFont(BaseFont font); ArrayList<BaseFont> getSubstitutionFonts(); void setSubstitutionFonts(ArrayList<BaseFont> substitutionFonts); XfaForm getXfa(); void removeXfa(); PushbuttonField getNewPushbuttonFromField(String field); PushbuttonField getNewPushbuttonFromField(String field, int order); boolean replacePushbuttonField(String field, PdfFormField button); boolean replacePushbuttonField(String field, PdfFormField button, int order); boolean doesSignatureFieldExist(String name); static final int DA_FONT; static final int DA_SIZE; static final int DA_COLOR; static final int FIELD_TYPE_NONE; static final int FIELD_TYPE_PUSHBUTTON; static final int FIELD_TYPE_CHECKBOX; static final int FIELD_TYPE_RADIOBUTTON; static final int FIELD_TYPE_TEXT; static final int FIELD_TYPE_LIST; static final int FIELD_TYPE_COMBO; static final int FIELD_TYPE_SIGNATURE; }