Пример #1
0
        public virtual void MakePdfUnknownAnnotationTest()
        {
            PdfDictionary @object = new PdfDictionary();

            // from DEVSIX-2661
            @object.Put(PdfName.Subtype, new PdfName("BatesN"));
            PdfAnnotation result = PdfAnnotation.MakeAnnotation(@object);

            NUnit.Framework.Assert.IsTrue(result is PdfAnnotation.PdfUnknownAnnotation);
        }
Пример #2
0
        public virtual void MakeIndirectPdfAnnotationTest()
        {
            PdfDictionary @object = new PdfDictionary();

            using (PdfDocument doc = new PdfDocument(new PdfWriter(new MemoryStream()))) {
                doc.AddNewPage();
                PdfObject indirect = @object.MakeIndirect(doc);
                @object.Put(PdfName.Subtype, PdfName.Text);
                PdfAnnotation result = PdfAnnotation.MakeAnnotation(indirect);
                NUnit.Framework.Assert.IsTrue(result is PdfTextAnnotation);
            }
        }