Example #1
0
        internal override Annotation Clone(IDocumentEssential owner, Page page)
        {
            PDFDictionary res = AnnotationBase.Copy(Dictionary);

            IPDFObject open = Dictionary["Open"];

            if (open != null)
            {
                res.AddItem("Open", open.Clone());
            }

            PopupAnnotation annot = new PopupAnnotation(res, owner);

            annot.SetPage(Page, false);
            annot.SetPage(page, true);
            return(annot);
        }
        public void PostPopupAnnotationTest()
        {
            const string parentId = "GI5TCMR3GE2TQLBSGM3CYMJYGUWDENRV";

            PopupAnnotation annotation = new PopupAnnotation(Rect: new Rectangle(100, 100, 200, 200))
            {
                Name  = "Test Popup Annotation",
                Flags = new List <AnnotationFlags> {
                    AnnotationFlags.Hidden, AnnotationFlags.NoView
                },
                HorizontalAlignment = HorizontalAlignment.Center,
                ZIndex   = 1,
                Modified = "01/01/2018 00:00:00.000 AM"
            };

            var response = PdfApi.PostPopupAnnotation(Name, parentId, annotation, folder: TempFolder);

            Assert.That(response.Code, Is.EqualTo(200));
        }
Example #3
0
        public void PostPopupAnnotationTest()
        {
            const string parentId = "GI5TCMR3GE2TQLBSGM3CYMJYGUWDENRV";

            PopupAnnotation annotation = new PopupAnnotation()
            {
                Name  = "Test Popup Annotation",
                Rect  = new Rectangle(100, 100, 200, 200),
                Flags = new List <AnnotationFlags> {
                    AnnotationFlags.Hidden, AnnotationFlags.NoView
                },
                HorizontalAlignment = HorizontalAlignment.Center,
                ZIndex   = 1,
                Modified = "01/01/2018 00:00:00.000 AM"
            };

            var response = api.PostPopupAnnotation(Name, parentId, annotation, folder: FolderName);

            Console.WriteLine(response);
        }
        public void PutPopupAnnotationTest()
        {
            PopupAnnotation annotation = new PopupAnnotation(Rect: new Rectangle(101, 101, 201, 201))
            {
                Name  = "Test Popup Annotation Updated",
                Flags = new List <AnnotationFlags> {
                    AnnotationFlags.Hidden, AnnotationFlags.NoView
                },
                HorizontalAlignment = HorizontalAlignment.Center,
                ZIndex   = 1,
                Modified = "02/02/2018 00:00:00.000 AM"
            };

            var    lineResponse = PdfApi.GetDocumentPopupAnnotations(Name, folder: TempFolder);
            string annotationId = lineResponse.Annotations.List[0].Id;

            var response = PdfApi.PutPopupAnnotation(Name, annotationId, annotation, folder: TempFolder);

            Assert.That(response.Code, Is.EqualTo(200));
        }
Example #5
0
        public void PutPopupAnnotationTest()
        {
            PopupAnnotation annotation = new PopupAnnotation()
            {
                Name  = "Test Popup Annotation Updated",
                Rect  = new Rectangle(101, 101, 201, 201),
                Flags = new List <AnnotationFlags> {
                    AnnotationFlags.Hidden, AnnotationFlags.NoView
                },
                HorizontalAlignment = HorizontalAlignment.Center,
                ZIndex   = 1,
                Modified = "02/02/2018 00:00:00.000 AM"
            };

            var    lineResponse = api.GetDocumentPopupAnnotations(Name, folder: FolderName);
            string annotationId = lineResponse.Annotations.List[0].Id;

            var response = api.PutPopupAnnotation(Name, annotationId, annotation, folder: FolderName);

            Console.WriteLine(response);
        }