示例#1
0
        public PDFBookmark(PDFDocument document, PDFBookmark parentBookmark, IntPtr nativePointer, IPDFDevice device)
        {
            if (document == null)
            {
                throw new NullReferenceException();
            }

            m_ParentBookmark = parentBookmark;
            m_NativePointer  = nativePointer;
            m_Document       = document;
            m_Device         = device;

            if (m_NativePointer == IntPtr.Zero)
            {
                m_Title = "ROOT";
            }

            PDFLibrary.AddRef("PDFBookmark");

            PDFBookmark firstChild = GetFirstChild();

            if (firstChild != null)
            {
                PDFBookmark previousSibling = firstChild;

                while (previousSibling != null)
                {
                    m_Bookmarks.Add(previousSibling);
                    previousSibling = previousSibling.GetNextSibling();
                }
            }
        }
示例#2
0
 public PDFBookmark(PDFDocument document, PDFBookmark parentBookmark, IntPtr nativePointer)
     : this(document, parentBookmark, nativePointer, null)
 {
     if (document == null)
     {
         throw new NullReferenceException();
     }
 }
示例#3
0
        public PDFAction(PDFBookmark bookmark, IntPtr nativePointer)
        {
            if (bookmark == null)
            {
                throw new NullReferenceException();
            }
            if (nativePointer == IntPtr.Zero)
            {
                throw new NullReferenceException();
            }

            PDFLibrary.AddRef("PDFAction");

            m_Source   = bookmark;
            m_Document = bookmark.Document;

            m_NativePointer = nativePointer;
        }
示例#4
0
        public static void ExecuteBookmarkAction(IPDFDevice device, PDFBookmark bookmark)
        {
            if (device.BookmarksActionHandler != null)
            {
                PDFDest dest = bookmark.GetDest();

                if (dest != null)
                {
                    device.BookmarksActionHandler.HandleGotoAction(device, dest.PageIndex);
                }
                else
                {
                    PDFAction action = bookmark.GetAction();

                    if (action != null)
                    {
                        ExecuteAction(device.BookmarksActionHandler, device, action);
                    }
                }
            }
        }