Sharp MuPDF demonstrates how to compile MuPDF source code into a dynamic link library and consume its functionality in .NET.
To compile the source code.
-
Install Visual Studio 2019 or newer versions.
-
Install python 3 (
Python.exe
must be accessible via the PATH environment variable). -
Open the
MuPDF.sln
in the solution folder with Visual Studio. -
Compile the solution.
-
During compilation, Python will be called to generate the definition file for the target dll file.
-
Results:
MuPDFLib
project will produce two DLL files for mupdf, one for x86 and the other for x64.Demo
project contains some code to demonstrate how to use functions in mupdflib.dll
Open the property page for the libmupdf
project.
Add ;TOFU;TOFU_CJK_EXT
to C/C++/Preprocessor/Preprocessor Definitions for All Configurations and All Platforms in configuration manager.
So you can exclude several huge fonts from the DLL.
-
Use
git pull
command to update the repository. -
To update source code, tags and submodules, use:
cd mupdf git pull origin master --recurse-submodules
It is possible that local modifications have been made. To discard local modifications when updating submodules, use the following command before
pull
ing from master:git reset --hard --recurse-submodules origin/master git reset --hard --recurse-submodules <TAG>
To fetch remote tags, use:
git fetch origin --tags
Afterwards, it is possible to check out the newly added tags:
git checkout <TAG>
-
Check out whether the mupdf has upgraded to a new version. If so, change the FZ_VERSION before compiling the solution after update.
If accessing the Internet requires HTTPS proxy, use the following command:
git config --global http.proxy <PROXY:PORT>
git config --global https.proxy <PROXY:PORT>
When you are done, use the following command to reset the proxy to default:
git config --global --unset http.proxy
git config --global --unset https.proxy
This project follows the license terms of MuPDF.