Esempio n. 1
0
        public virtual void SetGenerateAppearanceTest()
        {
            PdfDocument outputDoc = CreateDocument();
            PdfAcroForm acroForm  = PdfAcroForm.GetAcroForm(outputDoc, true);

            acroForm.SetNeedAppearances(false);
            acroForm.SetGenerateAppearance(true);
            bool   isModified           = acroForm.GetPdfObject().IsModified();
            bool   isReleaseForbidden   = acroForm.GetPdfObject().IsReleaseForbidden();
            bool   isGenerateAppearance = acroForm.IsGenerateAppearance();
            Object needAppearances      = acroForm.GetPdfObject().Get(PdfName.NeedAppearances);

            outputDoc.Close();
            NUnit.Framework.Assert.IsNull(needAppearances);
            NUnit.Framework.Assert.IsTrue(isGenerateAppearance);
            NUnit.Framework.Assert.IsTrue(isModified);
            NUnit.Framework.Assert.IsTrue(isReleaseForbidden);
        }