Esempio n. 1
0
        public List <PDFAnnotation> GetAnnotations()
        {
            List <PDFAnnotation> pDFAnnotations;

            try
            {
                List <PDFAnnotation> pDFAnnotations1 = new List <PDFAnnotation>();
                object[]             objArray        = IteratorUtils.toArray(this.PDFBoxPage.getAnnotations().iterator());
                object[]             objArray1       = objArray;
                for (int i = 0; i < (int)objArray1.Length; i++)
                {
                    pDFAnnotations1.Add(new PDFAnnotation((PDAnnotation)objArray1[i]));
                }
                pDFAnnotations = pDFAnnotations1;
            }
            catch (Exception exception1)
            {
                Exception exception = exception1;
                throw new PDFToolkitException(exception.Message, exception);
            }
            return(pDFAnnotations);
        }
Esempio n. 2
0
        public PDFBookmark GetBookmarks()
        {
            PDFBookmark pDFBookmark;

            try
            {
                PDDocumentOutline documentOutline = this.PDFBoxDocument.getDocumentCatalog().getDocumentOutline();
                PDFBookmark       pDFBookmark1    = new PDFBookmark();
                object[]          objArray        = IteratorUtils.toArray(documentOutline.children().iterator());
                for (int i = 0; i < (int)objArray.Length; i++)
                {
                    object obj = objArray[i];
                    PDFHelper.addBookmark((PDOutlineItem)obj, pDFBookmark1.BookmarkItems, this.PDFBoxDocument);
                }
                pDFBookmark = pDFBookmark1;
            }
            catch (Exception exception1)
            {
                Exception exception = exception1;
                throw new PDFToolkitException(exception.Message, exception);
            }
            return(pDFBookmark);
        }