예제 #1
0
 public virtual void AnnotationCheckTest04()
 {
     NUnit.Framework.Assert.That(() => {
         PdfWriter writer = new PdfWriter(new ByteArrayOutputStream());
         Stream @is       = new FileStream(sourceFolder + "sRGB Color Space Profile.icm", FileMode.Open, FileAccess.Read);
         PdfADocument doc = new PdfADocument(writer, PdfAConformanceLevel.PDF_A_1B, new PdfOutputIntent("Custom", ""
                                                                                                        , "http://www.color.org", "sRGB IEC61966-2.1", @is));
         PdfPage page              = doc.AddNewPage();
         Rectangle rect            = new Rectangle(100, 100, 100, 100);
         PdfMarkupAnnotation annot = new PdfTextAnnotation(rect);
         annot.SetFlag(PdfAnnotation.PRINT);
         annot.SetFlag(PdfAnnotation.INVISIBLE);
         page.AddAnnotation(annot);
         doc.Close();
     }
                                 , NUnit.Framework.Throws.TypeOf <PdfAConformanceException>().With.Message.EqualTo(PdfAConformanceException.TheFKeysPrintFlagBitShallBeSetTo1AndItsHiddenInvisibleAndNoviewFlagBitsShallBeSetTo0));
     ;
 }
 public virtual void AnnotationCheckTest04()
 {
     NUnit.Framework.Assert.That(() => {
         PdfWriter writer = new PdfWriter(new ByteArrayOutputStream());
         Stream @is       = new FileStream(sourceFolder + "sRGB Color Space Profile.icm", FileMode.Open, FileAccess.Read);
         PdfADocument doc = new PdfADocument(writer, PdfAConformanceLevel.PDF_A_1B, new PdfOutputIntent("Custom", ""
                                                                                                        , "http://www.color.org", "sRGB IEC61966-2.1", @is));
         PdfPage page              = doc.AddNewPage();
         Rectangle rect            = new Rectangle(100, 100, 100, 100);
         PdfMarkupAnnotation annot = new PdfTextAnnotation(rect);
         annot.SetFlag(PdfAnnotation.PRINT);
         annot.SetFlag(PdfAnnotation.INVISIBLE);
         page.AddAnnotation(annot);
         doc.Close();
     }
                                 , NUnit.Framework.Throws.InstanceOf <PdfAConformanceException>().With.Message.EqualTo(PdfAConformanceException.THE_F_KEYS_PRINT_FLAG_BIT_SHALL_BE_SET_TO_1_AND_ITS_HIDDEN_INVISIBLE_AND_NOVIEW_FLAG_BITS_SHALL_BE_SET_TO_0))
     ;
 }
 public virtual void AnnotationCheckTest02()
 {
     NUnit.Framework.Assert.That(() => {
         PdfWriter writer = new PdfWriter(new ByteArrayOutputStream());
         Stream @is       = new FileStream(sourceFolder + "sRGB Color Space Profile.icm", FileMode.Open, FileAccess.Read);
         PdfADocument doc = new PdfADocument(writer, PdfAConformanceLevel.PDF_A_1B, new PdfOutputIntent("Custom", ""
                                                                                                        , "http://www.color.org", "sRGB IEC61966-2.1", @is));
         PdfPage page              = doc.AddNewPage();
         Rectangle rect            = new Rectangle(100, 100, 100, 100);
         PdfMarkupAnnotation annot = new PdfTextAnnotation(rect);
         annot.SetFlag(PdfAnnotation.PRINT);
         annot.SetOpacity(new PdfNumber(0.5));
         page.AddAnnotation(annot);
         doc.Close();
     }
                                 , NUnit.Framework.Throws.InstanceOf <PdfAConformanceException>().With.Message.EqualTo(PdfAConformanceException.AN_ANNOTATION_DICTIONARY_SHALL_NOT_CONTAIN_THE_CA_KEY_WITH_A_VALUE_OTHER_THAN_1))
     ;
 }
예제 #4
0
 public virtual void AnnotationCheckTest02()
 {
     NUnit.Framework.Assert.That(() => {
         PdfWriter writer = new PdfWriter(new ByteArrayOutputStream());
         Stream @is       = new FileStream(sourceFolder + "sRGB Color Space Profile.icm", FileMode.Open, FileAccess.Read);
         PdfADocument doc = new PdfADocument(writer, PdfAConformanceLevel.PDF_A_1B, new PdfOutputIntent("Custom", ""
                                                                                                        , "http://www.color.org", "sRGB IEC61966-2.1", @is));
         PdfPage page              = doc.AddNewPage();
         Rectangle rect            = new Rectangle(100, 100, 100, 100);
         PdfMarkupAnnotation annot = new PdfTextAnnotation(rect);
         annot.SetFlag(PdfAnnotation.PRINT);
         annot.SetOpacity(new PdfNumber(0.5));
         page.AddAnnotation(annot);
         doc.Close();
     }
                                 , NUnit.Framework.Throws.TypeOf <PdfAConformanceException>().With.Message.EqualTo(PdfAConformanceException.AnAnnotationDictionaryShallNotContainTheCaKeyWithAValueOtherThan1));
     ;
 }