From 428ddbee794ec9e4d7d2da20a670becb11d7c813 Mon Sep 17 00:00:00 2001 From: WMJ Date: Sat, 30 Mar 2024 17:31:32 +0800 Subject: [PATCH] ! Update to MuPDF 1.23.11 --- Demo/Program.cs | 2 +- MuPDFLib/gen_libmupdf.def.py | 11 +++++ MuPDFLib/libmupdf.def | 81 ++++++++++++++++++++++++++++++++++++ mupdf | 2 +- 4 files changed, 94 insertions(+), 2 deletions(-) diff --git a/Demo/Program.cs b/Demo/Program.cs index d19c228..0ca73de 100644 --- a/Demo/Program.cs +++ b/Demo/Program.cs @@ -114,7 +114,7 @@ static class NativeMethods const uint FZ_STORE_DEFAULT = 256 << 20; const string DLL = "MuPDFLib.dll"; // note: modify the version number to match the FZ_VERSION definition in "include\fitz\version.h" file - const string FZ_VERSION = "1.23.6"; + const string FZ_VERSION = "1.23.11"; [DllImport(DLL, CallingConvention = CC.Cdecl, EntryPoint = "fz_new_context_imp", BestFitMapping = false)] static extern IntPtr NewContext(IntPtr alloc, IntPtr locks, uint max_store, [MarshalAs(UnmanagedType.LPStr)] string fz_version); diff --git a/MuPDFLib/gen_libmupdf.def.py b/MuPDFLib/gen_libmupdf.def.py index 98a2625..e9218de 100644 --- a/MuPDFLib/gen_libmupdf.def.py +++ b/MuPDFLib/gen_libmupdf.def.py @@ -44,6 +44,14 @@ def collectFunctions(file): %(jbig2_exports)s +; Leptonica exports + +%(leptonica_exports)s + +; Tesseract exports + +%(tesseract_exports)s + """ def main(): @@ -56,10 +64,13 @@ def main(): misc_exports = collectFunctions("source/fitz/test-device.c") + ["fz_set_stderr", "fz_set_stdout", "fz_colorspace_name_process_colorants", "fz_getoptw", "fz_valgrind_pixmap", "fz_stderr", "track_usage", "fz_log_errorFL", "fz_log_error_printfFL", "fz_morph_errorFL", "fz_rethrowFL", "fz_rethrow_ifFL", "fz_throwFL", "fz_vlog_error_printfFL", "fz_vthrowFL", "fz_vwarnFL", "fz_warnFL"] sign_exports = ["pdf_crypt_buffer", "pdf_read_pfx", "pdf_sign_signature", "pdf_signer_designated_name", "pdf_free_designated_name"] jbig2_exclude = collectFunctions("thirdparty/jbig2dec/jbig2_image_rw.h") + ["jbig2_dump_huffman_binary", "jbig2_dump_huffman_state", "jbig2_arith_has_reached_marker"] + tesseract_exclude = ["TessBaseAPIInitLangMod", "TessBaseAPIClearAdaptiveClassifier", "TessBaseAPIAdaptToWordStr"] fitz_exports = generateExports("include/mupdf/fitz", doc_exports + more_formats + misc_exports) mupdf_exports = generateExports("include/mupdf/pdf", form_exports + sign_exports + ["pdf_drop_designated_name", "pdf_print_xref", "pdf_recognize", "pdf_resolve_obj", "pdf_open_compressed_stream", "pdf_finish_edit"]) jbig2_exports = generateExports("thirdparty/jbig2dec", jbig2_exclude, "/jbig2*.h") + leptonica_exports = generateExports("thirdparty/leptonica/src", [], "/allheaders.h") + tesseract_exports = generateExports("thirdparty/tesseract/include/tesseract", tesseract_exclude, "/capi.h") list = LIBMUPDF_DEF % locals() open("../MuPDFLib/libmupdf.def", "wt").write(list.replace('\r\n', "\n")) diff --git a/MuPDFLib/libmupdf.def b/MuPDFLib/libmupdf.def index d1657f9..fb0b185 100644 --- a/MuPDFLib/libmupdf.def +++ b/MuPDFLib/libmupdf.def @@ -623,6 +623,7 @@ EXPORTS fz_pixmap_height fz_pixmap_x fz_pixmap_y + fz_pixmap_size fz_new_pixmap fz_new_pixmap_with_bbox fz_new_pixmap_with_data @@ -658,6 +659,9 @@ EXPORTS fz_clone_pixmap_area_with_different_seps fz_new_pixmap_from_alpha_channel fz_new_pixmap_from_color_and_mask + fz_scale_pixmap + fz_subsample_pixmap + fz_copy_pixmap_rect fz_new_pool fz_pool_alloc fz_pool_strdup @@ -821,6 +825,7 @@ EXPORTS fz_keep_text fz_drop_text fz_show_glyph + fz_show_glyph_aux fz_show_string fz_bound_text fz_text_language_from_string @@ -876,6 +881,7 @@ EXPORTS fz_write_pixmap_as_pdfocr fz_save_pixmap_as_pdfocr fz_save_pixmap_as_png + fz_write_pixmap_as_jpeg fz_save_pixmap_as_jpeg fz_write_pixmap_as_png fz_new_png_band_writer @@ -1532,6 +1538,7 @@ EXPORTS pdf_count_pages pdf_count_pages_imp pdf_lookup_page_obj + pdf_lookup_page_loc pdf_load_page_tree pdf_drop_page_tree pdf_drop_page_tree_internal @@ -1767,3 +1774,77 @@ EXPORTS jbig2_sd_count_referred jbig2_text_region +; Leptonica exports + + + +; Tesseract exports + + TessDeleteText + TessDeleteTextArray + TessDeleteIntArray + TessDeleteResultRenderer + TessResultRendererInsert + TessResultRendererBeginDocument + TessResultRendererAddImage + TessResultRendererEndDocument + TessResultRendererImageNum + TessBaseAPIDelete + TessBaseAPIGetOpenCLDevice + TessBaseAPISetInputName + TessBaseAPISetInputImage + TessBaseAPIGetSourceYResolution + TessBaseAPISetOutputName + TessBaseAPISetVariable + TessBaseAPISetDebugVariable + TessBaseAPIGetIntVariable + TessBaseAPIGetBoolVariable + TessBaseAPIGetDoubleVariable + TessBaseAPIPrintVariables + TessBaseAPIPrintVariablesToFile + TessBaseAPIInit1 + TessBaseAPIInit2 + TessBaseAPIInit3 + TessBaseAPIInit4 + TessBaseAPIInitForAnalysePage + TessBaseAPIReadConfigFile + TessBaseAPIReadDebugConfigFile + TessBaseAPISetPageSegMode + TessBaseAPIGetPageSegMode + TessBaseAPISetImage + TessBaseAPISetImage2 + TessBaseAPISetSourceResolution + TessBaseAPISetRectangle + TessBaseAPIGetThresholdedImageScaleFactor + TessBaseAPIRecognize + TessBaseAPIProcessPages + TessBaseAPIProcessPage + TessBaseAPIMeanTextConf + TessBaseAPIClear + TessBaseAPIEnd + TessBaseAPIIsValidWord + TessBaseAPIGetTextDirection + TessBaseAPISetMinOrientationMargin + TessPageIteratorDelete + TessPageIteratorBegin + TessPageIteratorNext + TessPageIteratorIsAtBeginningOf + TessPageIteratorIsAtFinalElement + TessPageIteratorBoundingBox + TessPageIteratorBaseline + TessPageIteratorOrientation + TessPageIteratorParagraphInfo + TessResultIteratorDelete + TessResultIteratorNext + TessResultIteratorConfidence + TessResultIteratorWordIsNumeric + TessChoiceIteratorDelete + TessChoiceIteratorNext + TessChoiceIteratorConfidence + TessMonitorDelete + TessMonitorSetCancelFunc + TessMonitorSetCancelThis + TessMonitorSetProgressFunc + TessMonitorGetProgress + TessMonitorSetDeadlineMSecs + diff --git a/mupdf b/mupdf index a7c9c70..4e5bbc5 160000 --- a/mupdf +++ b/mupdf @@ -1 +1 @@ -Subproject commit a7c9c708ab970171aca9c4c05582d3e26966d420 +Subproject commit 4e5bbc59dc81ba065cbc9a79cb0293783d6b26dd