Skip to content

Commit

Permalink
! Update to MuPDF 1.23.11
Browse files Browse the repository at this point in the history
  • Loading branch information
wmjordan committed Mar 30, 2024
1 parent 6fb7e6f commit 428ddbe
Show file tree
Hide file tree
Showing 4 changed files with 94 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Demo/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
11 changes: 11 additions & 0 deletions MuPDFLib/gen_libmupdf.def.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,14 @@ def collectFunctions(file):
%(jbig2_exports)s
; Leptonica exports
%(leptonica_exports)s
; Tesseract exports
%(tesseract_exports)s
"""

def main():
Expand All @@ -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"))
Expand Down
81 changes: 81 additions & 0 deletions MuPDFLib/libmupdf.def
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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

0 comments on commit 428ddbe

Please sign in to comment.