Beispiel #1
0
 public virtual void CheckAppearanceStreamWithoutTransparencyGroup()
 {
     using (MemoryStream bos = new MemoryStream()) {
         using (PdfWriter writer = new PdfWriter(bos)) {
             using (PdfDocument document = new PdfDocument(writer)) {
                 PdfFormXObject formXObject = new PdfFormXObject(new Rectangle(0f, 0f));
                 PdfAnnotation  annotation  = new PdfPopupAnnotation(new Rectangle(0f, 0f));
                 annotation.SetNormalAppearance(formXObject.GetPdfObject());
                 PdfPage pageToCheck = document.AddNewPage();
                 pageToCheck.AddAnnotation(new PdfPopupAnnotation(new Rectangle(0f, 0f)));
                 pageToCheck.AddAnnotation(annotation);
                 EnsureTransparencyObjectsNotEmpty();
                 // no assertions as we want to check that no exceptions would be thrown
                 pdfA2Checker.CheckSinglePage(pageToCheck);
             }
         }
     }
 }
Beispiel #2
0
 public virtual void CheckAppearanceStreamWithTransparencyGroup()
 {
     using (MemoryStream bos = new MemoryStream()) {
         using (PdfWriter writer = new PdfWriter(bos)) {
             using (PdfDocument document = new PdfDocument(writer)) {
                 PdfFormXObject formXObject = new PdfFormXObject(new Rectangle(0f, 0f));
                 formXObject.SetGroup(new PdfTransparencyGroup());
                 PdfAnnotation annotation = new PdfPopupAnnotation(new Rectangle(0f, 0f));
                 annotation.SetNormalAppearance(formXObject.GetPdfObject());
                 PdfPage pageToCheck = document.AddNewPage();
                 pageToCheck.AddAnnotation(new PdfPopupAnnotation(new Rectangle(0f, 0f)));
                 pageToCheck.AddAnnotation(annotation);
                 NUnit.Framework.Assert.That(() => {
                     pdfA2Checker.CheckSinglePage(pageToCheck);
                 }
                                             , NUnit.Framework.Throws.InstanceOf <PdfAConformanceException>().With.Message.EqualTo(PdfAConformanceException.THE_DOCUMENT_DOES_NOT_CONTAIN_A_PDFA_OUTPUTINTENT_BUT_PAGE_CONTAINS_TRANSPARENCY_AND_DOES_NOT_CONTAIN_BLENDING_COLOR_SPACE))
                 ;
             }
         }
     }
 }