PdfAcroForm extends PdfObjectWrapper<PdfDictionary> { public PdfAcroForm setSignatureFlags(int sigFlags) { return put(PdfName.SigFlags, new PdfNumber(sigFlags)); } private  PdfAcroForm(PdfDictionary pdfObject, PdfDocument pdfDocument); private  PdfAcroForm(PdfArray fields); static PdfAcroForm getAcroForm(PdfDocument document, boolean createIfNotExist); void addField(PdfFormField field); void addField(PdfFormField field, PdfPage page); void addFieldAppearanceToPage(PdfFormField field, PdfPage page); Map<String, PdfFormField> getFormFields(); Collection<PdfFormField> getFieldsForFlattening(); PdfDocument getPdfDocument(); PdfAcroForm setNeedAppearances(boolean needAppearances); PdfBoolean getNeedAppearances(); PdfAcroForm setSignatureFlags(int sigFlags); PdfAcroForm setSignatureFlag(int sigFlag); int getSignatureFlags(); PdfAcroForm setCalculationOrder(PdfArray calculationOrder); PdfArray getCalculationOrder(); PdfAcroForm setDefaultResources(PdfDictionary defaultResources); PdfDictionary getDefaultResources(); PdfAcroForm setDefaultAppearance(String appearance); PdfString getDefaultAppearance(); PdfAcroForm setDefaultJustification(int justification); PdfNumber getDefaultJustification(); PdfAcroForm setXFAResource(PdfStream xfaResource); PdfAcroForm setXFAResource(PdfArray xfaResource); PdfObject getXFAResource(); PdfFormField getField(String fieldName); boolean isGenerateAppearance(); void setGenerateAppearance(boolean generateAppearance); void flattenFields(); boolean removeField(String fieldName); void partialFormFlattening(String fieldName); void renameField(String oldName, String newName); PdfFormField copyField(String name); void replaceField(String name, PdfFormField field); boolean hasXfaForm(); XfaForm getXfaForm(); void removeXfaForm(); PdfAcroForm put(PdfName key, PdfObject value); void release(); @Override PdfObjectWrapper<PdfDictionary> setModified(); static final int SIGNATURE_EXIST; static final int APPEND_ONLY; }
@Test public void setSignatureFlagsTest() { PdfDocument outputDoc = createDocument(); PdfAcroForm acroForm = PdfAcroForm.getAcroForm(outputDoc, true); acroForm.setSignatureFlags(65); boolean isModified = acroForm.getPdfObject().isModified(); boolean isReleaseForbidden = acroForm.getPdfObject().isReleaseForbidden(); PdfObject sigFlags = acroForm.getPdfObject().get(PdfName.SigFlags); outputDoc.close(); Assert.assertEquals(new PdfNumber(65), sigFlags); Assert.assertTrue(isModified); Assert.assertTrue(isReleaseForbidden); }