public PDFDocument(IntPtr nativePointer) { PDFLibrary.AddRef("PDFDocument"); m_NativePointer = nativePointer; m_ValidDocument = true; }
public PDFPage(PDFDocument document, int pageIndex) { if (document == null) { throw new NullReferenceException(); } if (pageIndex < 0) { throw new ArgumentOutOfRangeException(); } PDFLibrary.AddRef("PDFPage"); m_Document = document; m_PageIndex = pageIndex; m_NativePointer = FPDF_LoadPage(document.NativePointer, m_PageIndex); if (m_NativePointer != IntPtr.Zero) { if (s_InstanceMap.ContainsKey(m_NativePointer)) { s_InstanceMap[m_NativePointer] = s_InstanceMap[m_NativePointer] + 1; } else { s_InstanceMap[m_NativePointer] = 1; } } }
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(); } } }
public PDFPage(PDFDocument document, IntPtr pageHandle, int pageIndex) { PDFLibrary.AddRef("PDFPage"); m_Document = document; m_PageIndex = pageIndex; m_NativePointer = pageHandle; }
/// <summary> /// /// </summary> /// <param name="filePath"></param> /// <param name="password">Can be null or empty</param> public PDFDocument(string filePath, string password) { PDFLibrary.AddRef("PDFDocument"); #if !UNITY_WEBPLAYER CommonInit(File.ReadAllBytes(filePath), password); #else m_ValidDocument = false; #endif }
public PDFLink(PDFPage page, IntPtr nativePointer) { if (page == null) { throw new NullReferenceException(); } if (nativePointer == IntPtr.Zero) { throw new NullReferenceException(); } PDFLibrary.AddRef("PDFLink"); m_Page = page; m_NativePointer = nativePointer; }
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; }
public PDFAction(PDFLink link, IntPtr nativePointer) { if (link == null) { throw new NullReferenceException(); } if (nativePointer == IntPtr.Zero) { throw new NullReferenceException(); } PDFLibrary.AddRef("PDFAction"); m_Source = link; m_Document = link.Page.Document; m_NativePointer = nativePointer; }
public PDFDest(PDFAction action, IntPtr nativePointer) { if (action == null) { throw new NullReferenceException(); } if (nativePointer == IntPtr.Zero) { throw new NullReferenceException(); } PDFLibrary.AddRef("PDFDest"); m_Source = action; m_Document = action.Document; m_NativePointer = nativePointer; }
public PDFTextPage(PDFPage page) { if (page == null) { throw new NullReferenceException(); } PDFLibrary.AddRef("PDFTextPage"); m_Page = page; m_NativePointer = FPDFText_LoadPage(m_Page.NativePointer); if (m_NativePointer != IntPtr.Zero) { if (s_InstanceMap.ContainsKey(m_NativePointer)) { s_InstanceMap[m_NativePointer] = s_InstanceMap[m_NativePointer] + 1; } else { s_InstanceMap[m_NativePointer] = 1; } } }
public PDFSearchHandle(PDFTextPage textPage, byte[] findWhatUnicode, int startIndex, MatchOption flags = MatchOption.NONE) { if (textPage == null) { throw new NullReferenceException(); } if (startIndex < 0) { throw new ArgumentOutOfRangeException(); } PDFLibrary.AddRef("PDFSearchHandle"); m_TextPage = textPage; IntPtr unmanagedPointer = Marshal.AllocHGlobal(findWhatUnicode.Length); Marshal.Copy(findWhatUnicode, 0, unmanagedPointer, findWhatUnicode.Length); m_NativePointer = FPDFText_FindStart(textPage.NativePointer, unmanagedPointer, (int)flags, startIndex); Marshal.FreeHGlobal(unmanagedPointer); }
public PDFRenderer() { PDFLibrary.AddRef("PDFRenderer"); }
/// <summary> /// Open PDF Document with the specified byte array. /// </summary> /// <param name="buffer"></param> /// <param name="password">Can be null or empty</param> public PDFDocument(byte[] buffer, string password) { PDFLibrary.AddRef("PDFDocument"); CommonInit(buffer, password); }