From f9d53ed3004723bdab4f6554649bda53016497ca Mon Sep 17 00:00:00 2001 From: Ryan Weldin Date: Sun, 26 Aug 2018 22:33:54 -0500 Subject: [PATCH] Pdfium API removed FPDFDest_GetPageIndex Changes on 8/23/18 at https://pdfium.googlesource.com/pdfium/+/e919ec18fc0b008241e5e5371d5762e9fe89de6f state FPDFDest_GetDestPageIndex is to be used instead of FPDFDest_GetPageIndex --- PdfiumViewer/NativeMethods.Pdfium.cs | 6 +++--- PdfiumViewer/PdfFile.cs | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/PdfiumViewer/NativeMethods.Pdfium.cs b/PdfiumViewer/NativeMethods.Pdfium.cs index 33c245a..8f6bcfb 100644 --- a/PdfiumViewer/NativeMethods.Pdfium.cs +++ b/PdfiumViewer/NativeMethods.Pdfium.cs @@ -330,11 +330,11 @@ public static IntPtr FPDFLink_GetDest(IntPtr document, IntPtr link) } } - public static uint FPDFDest_GetPageIndex(IntPtr document, IntPtr dest) + public static uint FPDFDest_GetDestPageIndex(IntPtr document, IntPtr dest) { lock (LockString) { - return Imports.FPDFDest_GetPageIndex(document, dest); + return Imports.FPDFDest_GetDestPageIndex(document, dest); } } @@ -712,7 +712,7 @@ private static class Imports public static extern IntPtr FPDFLink_GetDest(IntPtr document, IntPtr link); [DllImport("pdfium.dll")] - public static extern uint FPDFDest_GetPageIndex(IntPtr document, IntPtr dest); + public static extern uint FPDFDest_GetDestPageIndex(IntPtr document, IntPtr dest); [DllImport("pdfium.dll")] public static extern bool FPDFLink_GetAnnotRect(IntPtr linkAnnot, FS_RECTF rect); diff --git a/PdfiumViewer/PdfFile.cs b/PdfiumViewer/PdfFile.cs index 298e819..225db37 100644 --- a/PdfiumViewer/PdfFile.cs +++ b/PdfiumViewer/PdfFile.cs @@ -91,7 +91,7 @@ public PdfPageLinks GetPageLinks(int pageNumber, Size pageSize) string uri = null; if (destination != IntPtr.Zero) - target = (int)NativeMethods.FPDFDest_GetPageIndex(_document, destination); + target = (int)NativeMethods.FPDFDest_GetDestPageIndex(_document, destination); var action = NativeMethods.FPDFLink_GetAction(annotation); if (action != IntPtr.Zero) @@ -227,7 +227,7 @@ private uint GetBookmarkPageIndex(IntPtr bookmark) { IntPtr dest = NativeMethods.FPDF_BookmarkGetDest(_document, bookmark); if (dest != IntPtr.Zero) - return NativeMethods.FPDFDest_GetPageIndex(_document, dest); + return NativeMethods.FPDFDest_GetDestPageIndex(_document, dest); return 0; }