diff --git a/download_package.sh b/download_package.sh index 0bb3da0..b2b27c6 100755 --- a/download_package.sh +++ b/download_package.sh @@ -1,2 +1,2 @@ dotnet build src/PDFiumCoreBindingsGenerator/PDFiumCoreBindingsGenerator.csproj -c Release -dotnet ./src/PDFiumCoreBindingsGenerator/bin/Release/net6.0/PDFiumCoreBindingsGenerator.dll 163323669 false +dotnet ./src/PDFiumCoreBindingsGenerator/bin/Release/net6.0/PDFiumCoreBindingsGenerator.dll 171884604 false diff --git a/src/Directory.Build.props b/src/Directory.Build.props index cce9990..c8c9d5b 100644 --- a/src/Directory.Build.props +++ b/src/Directory.Build.props @@ -1,6 +1,6 @@ - 128.0.6569.0 + 130.0.6679.0 diff --git a/src/PDFiumCore/PDFiumCore.cs b/src/PDFiumCore/PDFiumCore.cs index ac4b915..39c3707 100644 --- a/src/PDFiumCore/PDFiumCore.cs +++ b/src/PDFiumCore/PDFiumCore.cs @@ -1,7 +1,7 @@ -// Built from precompiled binaries at https://github.com/bblanchon/pdfium-binaries/releases/tag/chromium/6569 -// Github release api https://api.github.com/repos/bblanchon/pdfium-binaries/releases/163323669 -// PDFium version v128.0.6569.0 chromium/6569 [master] -// Built on: Mon, 01 Jul 2024 14:04:37 GMT +// Built from precompiled binaries at https://github.com/bblanchon/pdfium-binaries/releases/tag/chromium/6679 +// Github release api https://api.github.com/repos/bblanchon/pdfium-binaries/releases/171884604 +// PDFium version v130.0.6679.0 chromium/6679 [master] +// Built on: Mon, 26 Aug 2024 15:21:35 GMT // ---------------------------------------------------------------------------- // // This is autogenerated code by CppSharp. @@ -3312,7 +3312,7 @@ public partial struct __Internal internal static extern int FPDFBitmapGetFormat(__IntPtr bitmap); [SuppressUnmanagedCodeSecurity, DllImport("pdfium", EntryPoint = "FPDFBitmap_FillRect", CallingConvention = __CallingConvention.Cdecl)] - internal static extern void FPDFBitmapFillRect(__IntPtr bitmap, int left, int top, int width, int height, uint color); + internal static extern int FPDFBitmapFillRect(__IntPtr bitmap, int left, int top, int width, int height, uint color); [SuppressUnmanagedCodeSecurity, DllImport("pdfium", EntryPoint = "FPDFBitmap_GetBuffer", CallingConvention = __CallingConvention.Cdecl)] internal static extern __IntPtr FPDFBitmapGetBuffer(__IntPtr bitmap); @@ -4021,15 +4021,16 @@ public static int FPDFBitmapGetFormat(global::PDFiumCore.FpdfBitmapT bitmap) /// height - Height in pixels to be filled. /// color - A 32-bit value specifing the color, in 8888 ARGB format. /// Return value: - /// None. + /// Returns whether the operation succeeded or not. /// Comments: This function sets the color and (optionally) alpha value in the specified region of the bitmap. /// NOTE: If the alpha channel is used, this function does NOT composite the background with the source color, instead the background will be replaced by the source color and the alpha. /// If the alpha channel is not used, the alpha parameter is ignored. /// - public static void FPDFBitmapFillRect(global::PDFiumCore.FpdfBitmapT bitmap, int left, int top, int width, int height, uint color) + public static int FPDFBitmapFillRect(global::PDFiumCore.FpdfBitmapT bitmap, int left, int top, int width, int height, uint color) { var __arg0 = bitmap is null ? __IntPtr.Zero : bitmap.__Instance; - __Internal.FPDFBitmapFillRect(__arg0, left, top, width, height, color); + var __ret = __Internal.FPDFBitmapFillRect(__arg0, left, top, width, height, color); + return __ret; } /// @@ -8076,6 +8077,9 @@ public partial struct __Internal { [SuppressUnmanagedCodeSecurity, DllImport("pdfium", EntryPoint = "FPDFCatalog_IsTagged", CallingConvention = __CallingConvention.Cdecl)] internal static extern int FPDFCatalogIsTagged(__IntPtr document); + + [SuppressUnmanagedCodeSecurity, DllImport("pdfium", EntryPoint = "FPDFCatalog_SetLanguage", CallingConvention = __CallingConvention.Cdecl)] + internal static extern int FPDFCatalogSetLanguage(__IntPtr document, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(CppSharp.Runtime.UTF8Marshaller))] string language); } /// @@ -8092,6 +8096,20 @@ public static int FPDFCatalogIsTagged(global::PDFiumCore.FpdfDocumentT document) var __ret = __Internal.FPDFCatalogIsTagged(__arg0); return __ret; } + + /// + /// Experimental API. + /// Sets the language of |document| to |language|. + /// document - handle to a document. + /// language - the language to set to. + /// Returns TRUE on success. + /// + public static int FPDFCatalogSetLanguage(global::PDFiumCore.FpdfDocumentT document, string language) + { + var __arg0 = document is null ? __IntPtr.Zero : document.__Instance; + var __ret = __Internal.FPDFCatalogSetLanguage(__arg0, language); + return __ret; + } } public unsafe partial class FX_FILEAVAIL : IDisposable @@ -9383,6 +9401,9 @@ public partial struct __Internal [SuppressUnmanagedCodeSecurity, DllImport("pdfium", EntryPoint = "FPDFPageObj_Transform", CallingConvention = __CallingConvention.Cdecl)] internal static extern void FPDFPageObjTransform(__IntPtr page_object, double a, double b, double c, double d, double e, double f); + [SuppressUnmanagedCodeSecurity, DllImport("pdfium", EntryPoint = "FPDFPageObj_TransformF", CallingConvention = __CallingConvention.Cdecl)] + internal static extern int FPDFPageObjTransformF(__IntPtr page_object, __IntPtr matrix); + [SuppressUnmanagedCodeSecurity, DllImport("pdfium", EntryPoint = "FPDFPageObj_GetMatrix", CallingConvention = __CallingConvention.Cdecl)] internal static extern int FPDFPageObjGetMatrix(__IntPtr page_object, __IntPtr matrix); @@ -9395,6 +9416,9 @@ public partial struct __Internal [SuppressUnmanagedCodeSecurity, DllImport("pdfium", EntryPoint = "FPDFPageObj_NewImageObj", CallingConvention = __CallingConvention.Cdecl)] internal static extern __IntPtr FPDFPageObjNewImageObj(__IntPtr document); + [SuppressUnmanagedCodeSecurity, DllImport("pdfium", EntryPoint = "FPDFPageObj_GetMarkedContentID", CallingConvention = __CallingConvention.Cdecl)] + internal static extern int FPDFPageObjGetMarkedContentID(__IntPtr page_object); + [SuppressUnmanagedCodeSecurity, DllImport("pdfium", EntryPoint = "FPDFPageObj_CountMarks", CallingConvention = __CallingConvention.Cdecl)] internal static extern int FPDFPageObjCountMarks(__IntPtr page_object); @@ -9611,8 +9635,11 @@ public partial struct __Internal [SuppressUnmanagedCodeSecurity, DllImport("pdfium", EntryPoint = "FPDFTextObj_GetFont", CallingConvention = __CallingConvention.Cdecl)] internal static extern __IntPtr FPDFTextObjGetFont(__IntPtr text); - [SuppressUnmanagedCodeSecurity, DllImport("pdfium", EntryPoint = "FPDFFont_GetFontName", CallingConvention = __CallingConvention.Cdecl)] - internal static extern uint FPDFFontGetFontName(__IntPtr font, sbyte* buffer, uint length); + [SuppressUnmanagedCodeSecurity, DllImport("pdfium", EntryPoint = "FPDFFont_GetBaseFontName", CallingConvention = __CallingConvention.Cdecl)] + internal static extern ulong FPDFFontGetBaseFontName(__IntPtr font, sbyte* buffer, ulong length); + + [SuppressUnmanagedCodeSecurity, DllImport("pdfium", EntryPoint = "FPDFFont_GetFamilyName", CallingConvention = __CallingConvention.Cdecl)] + internal static extern ulong FPDFFontGetFamilyName(__IntPtr font, sbyte* buffer, ulong length); [SuppressUnmanagedCodeSecurity, DllImport("pdfium", EntryPoint = "FPDFFont_GetFontData", CallingConvention = __CallingConvention.Cdecl)] internal static extern int FPDFFontGetFontData(__IntPtr font, byte* buffer, ulong buflen, ulong* out_buflen); @@ -9904,6 +9931,25 @@ public static void FPDFPageObjTransform(global::PDFiumCore.FpdfPageobjectT page_ __Internal.FPDFPageObjTransform(__arg0, a, b, c, d, e, f); } + /// + /// Experimental API. + /// Transform |page_object| by the given matrix. + /// page_object - handle to a page object. + /// matrix - the transform matrix. + /// Returns TRUE on success. + /// This can be used to scale, rotate, shear and translate the |page_object|. + /// It is an improved version of FPDFPageObj_Transform() that does not do + /// unnecessary double to float conversions, and only uses 1 parameter for the + /// matrix. It also returns whether the operation succeeded or not. + /// + public static int FPDFPageObjTransformF(global::PDFiumCore.FpdfPageobjectT page_object, global::PDFiumCore.FS_MATRIX_ matrix) + { + var __arg0 = page_object is null ? __IntPtr.Zero : page_object.__Instance; + var __arg1 = matrix is null ? __IntPtr.Zero : matrix.__Instance; + var __ret = __Internal.FPDFPageObjTransformF(__arg0, __arg1); + return __ret; + } + /// /// Experimental API. /// Get the transform matrix of a page object. @@ -9979,6 +10025,19 @@ public static void FPDFPageTransformAnnots(global::PDFiumCore.FpdfPageT page, do return __result0; } + /// + /// Experimental API. + /// Get the marked content ID for the object. + /// page_object - handle to a page object. + /// Returns the page object's marked content ID, or -1 on error. + /// + public static int FPDFPageObjGetMarkedContentID(global::PDFiumCore.FpdfPageobjectT page_object) + { + var __arg0 = page_object is null ? __IntPtr.Zero : page_object.__Instance; + var __ret = __Internal.FPDFPageObjGetMarkedContentID(__arg0); + return __ret; + } + /// /// Experimental API. /// Get number of content marks in |page_object|. @@ -11293,20 +11352,40 @@ public static uint FPDFTextObjGetText(global::PDFiumCore.FpdfPageobjectT text_ob /// /// Experimental API. - /// Get the font name of a font. + /// Get the base name of a font. + /// font - the handle to the font object. + /// buffer - the address of a buffer that receives the base font name. + /// length - the size, in bytes, of |buffer|. + /// Returns the number of bytes in the base name (including the trailing NUL + /// character) on success, 0 on error. The base name is typically the font's + /// PostScript name. See descriptions of "BaseFont" in ISO 32000-1:2008 spec. + /// Regardless of the platform, the |buffer| is always in UTF-8 encoding. + /// If |length| is less than the returned length, or |buffer| is NULL, |buffer| + /// will not be modified. + /// + public static ulong FPDFFontGetBaseFontName(global::PDFiumCore.FpdfFontT font, sbyte* buffer, ulong length) + { + var __arg0 = font is null ? __IntPtr.Zero : font.__Instance; + var __ret = __Internal.FPDFFontGetBaseFontName(__arg0, buffer, length); + return __ret; + } + + /// + /// Experimental API. + /// Get the family name of a font. /// font - the handle to the font object. /// buffer - the address of a buffer that receives the font name. /// length - the size, in bytes, of |buffer|. - /// Returns the number of bytes in the font name (including the trailing NUL + /// Returns the number of bytes in the family name (including the trailing NUL /// character) on success, 0 on error. /// Regardless of the platform, the |buffer| is always in UTF-8 encoding. /// If |length| is less than the returned length, or |buffer| is NULL, |buffer| /// will not be modified. /// - public static uint FPDFFontGetFontName(global::PDFiumCore.FpdfFontT font, sbyte* buffer, uint length) + public static ulong FPDFFontGetFamilyName(global::PDFiumCore.FpdfFontT font, sbyte* buffer, ulong length) { var __arg0 = font is null ? __IntPtr.Zero : font.__Instance; - var __ret = __Internal.FPDFFontGetFontName(__arg0, buffer, length); + var __ret = __Internal.FPDFFontGetFamilyName(__arg0, buffer, length); return __ret; } @@ -13844,6 +13923,9 @@ public partial struct __Internal [SuppressUnmanagedCodeSecurity, DllImport("pdfium", EntryPoint = "FPDFText_GetUnicode", CallingConvention = __CallingConvention.Cdecl)] internal static extern uint FPDFTextGetUnicode(__IntPtr text_page, int index); + [SuppressUnmanagedCodeSecurity, DllImport("pdfium", EntryPoint = "FPDFText_GetTextObject", CallingConvention = __CallingConvention.Cdecl)] + internal static extern __IntPtr FPDFTextGetTextObject(__IntPtr text_page, int index); + [SuppressUnmanagedCodeSecurity, DllImport("pdfium", EntryPoint = "FPDFText_IsGenerated", CallingConvention = __CallingConvention.Cdecl)] internal static extern int FPDFTextIsGenerated(__IntPtr text_page, int index); @@ -13862,9 +13944,6 @@ public partial struct __Internal [SuppressUnmanagedCodeSecurity, DllImport("pdfium", EntryPoint = "FPDFText_GetFontWeight", CallingConvention = __CallingConvention.Cdecl)] internal static extern int FPDFTextGetFontWeight(__IntPtr text_page, int index); - [SuppressUnmanagedCodeSecurity, DllImport("pdfium", EntryPoint = "FPDFText_GetTextRenderMode", CallingConvention = __CallingConvention.Cdecl)] - internal static extern global::PDFiumCore.FPDF_TEXT_RENDERMODE FPDFTextGetTextRenderMode(__IntPtr text_page, int index); - [SuppressUnmanagedCodeSecurity, DllImport("pdfium", EntryPoint = "FPDFText_GetFillColor", CallingConvention = __CallingConvention.Cdecl)] internal static extern int FPDFTextGetFillColor(__IntPtr text_page, int index, uint* R, uint* G, uint* B, uint* A); @@ -14011,6 +14090,25 @@ public static uint FPDFTextGetUnicode(global::PDFiumCore.FpdfTextpageT text_page return __ret; } + /// + /// Function: FPDFText_GetTextObject + /// Get the FPDF_PAGEOBJECT associated with a given character. + /// Parameters: + /// text_page - Handle to a text page information structure. Returned by FPDFText_LoadPage function. + /// index - Zero-based index of the character. + /// Return value: + /// The associated text object for the character at |index|, or NULL on + /// error. The returned text object, if non-null, is of type + /// |FPDF_PAGEOBJ_TEXT|. The caller does not own the returned object. + /// + public static global::PDFiumCore.FpdfPageobjectT FPDFTextGetTextObject(global::PDFiumCore.FpdfTextpageT text_page, int index) + { + var __arg0 = text_page is null ? __IntPtr.Zero : text_page.__Instance; + var __ret = __Internal.FPDFTextGetTextObject(__arg0, index); + var __result0 = global::PDFiumCore.FpdfPageobjectT.__GetOrCreateInstance(__ret, false); + return __result0; + } + /// /// Function: FPDFText_IsGenerated /// Get if a character in a page is generated by PDFium. @@ -14128,25 +14226,6 @@ public static int FPDFTextGetFontWeight(global::PDFiumCore.FpdfTextpageT text_pa return __ret; } - /// - /// Function: FPDFText_GetTextRenderMode - /// Get text rendering mode of character. - /// Parameters: - /// text_page - Handle to a text page information structure. Returned by FPDFText_LoadPage function. - /// index - Zero-based index of the character. - /// Return Value: - /// On success, return the render mode value. A valid value is of type - /// FPDF_TEXT_RENDERMODE. If |text_page| is invalid, if |index| is out - /// of bounds, or if the text object is undefined, then return - /// FPDF_TEXTRENDERMODE_UNKNOWN. - /// - public static global::PDFiumCore.FPDF_TEXT_RENDERMODE FPDFTextGetTextRenderMode(global::PDFiumCore.FpdfTextpageT text_page, int index) - { - var __arg0 = text_page is null ? __IntPtr.Zero : text_page.__Instance; - var __ret = __Internal.FPDFTextGetTextRenderMode(__arg0, index); - return __ret; - } - /// /// Function: FPDFText_GetFillColor /// Get the fill color of a particular character.