Beispiel #1
0
        protected void LoadDocument(IntPtr document)
        {
            _document = document;

            NativePdfiumMethods.FPDF_GetDocPermissions(_document);

            _formCallbacks         = new NativePdfiumMethods.FPDF_FORMFILLINFO();
            _formCallbacksHandle   = GCHandle.Alloc(_formCallbacks);
            _formCallbacks.version = 1;

            _form = NativePdfiumMethods.FPDFDOC_InitFormFillEnvironment(_document, ref _formCallbacks);
            NativePdfiumMethods.FPDF_SetFormFieldHighlightColor(_form, 0, 0xFFE4DD);
            NativePdfiumMethods.FPDF_SetFormFieldHighlightAlpha(_form, 100);

            NativePdfiumMethods.FORM_DoDocumentJSAction(_form);
            NativePdfiumMethods.FORM_DoDocumentOpenAction(_form);

            Bookmarks = new PdfBookmarkCollection();

            LoadBookmarks(Bookmarks, NativePdfiumMethods.FPDF_BookmarkGetFirstChild(document, IntPtr.Zero));
        }