SharpMuPDF
SharpMuPDF copied to clipboard
Compiled DLL for MuPDF (https://github.com/ArtifexSoftware/mupdf) with a C# P/Invoke demo program
Sharp MuPDF
Sharp MuPDF demonstrates how to compile MuPDF source code into a dynamic link library and consume its functionality in .NET.
Compile
To compile the source code.
-
Install Visual Studio 2019 or newer versions.
-
Install python 3 (
Python.exemust be accessible via the PATH environment variable). -
Open the
MuPDF.slnin 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:
MuPDFLibproject will produce two DLL files for mupdf, one for x86 and the other for x64.Demoproject contains some code to demonstrate how to use functions in mupdflib.dll
Shrinking MuPDF.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.
Update source code
-
Use
git pullcommand to update the repository. -
To update source code, tags and submodules, use:
cd mupdf git pull origin master --recurse-submodulesIt is possible that local modifications have been made. To discard local modifications when updating submodules, use the following command before
pulling from master:git reset --hard --recurse-submodules origin/master git reset --hard --recurse-submodules <TAG>To fetch remote tags, use:
git fetch origin --tagsAfterwards, 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.
Git Proxy
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
License
This project follows the license terms of MuPDF.