Exemplo n.º 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();
                }
            }
        }
Exemplo n.º 2
0
 public PDFBookmark(PDFDocument document, PDFBookmark parentBookmark, IntPtr nativePointer)
     : this(document, parentBookmark, nativePointer, null)
 {
     if (document == null)
     {
         throw new NullReferenceException();
     }
 }
Exemplo n.º 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;
        }
Exemplo n.º 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);
                    }
                }
            }
        }