MuPDF.NET adds C# bindings and abstractions to MuPDF, a lightweight PDF, XPS, and eBook viewer, renderer, and toolkit. Both MuPDF.NET and MuPDF are maintained and developed by Artifex Software, Inc.
While being portable to other platforms, this documentation is targeted to the Windows operating system and Visual Studio only.
- Visual Studio Community version 2019 or version 2022
- .Net v7 or later
This is only required if you want to create a local version of the package. For creating an application that uses MuPDF.NET, please skip to the next section.
-
Clone this repository.
-
Expand folder
MuPDF.NET
and double-click on fileMuPDF.NET.sln
. This will start your Visual Studio application. -
Select
Release
andx64
and selectBuild|Solution
. Look at the window "Solution Explorer". If you see warnings like in this picture, click on "Install" as indicated to install any missing components. -
Again select
Build|Solution
and make sure the generation is successful. -
Folder
MuPDF.NET
will now contain some DLL files of which you needmupdfcpp64.dll
andmupdfcsharp.dll
for all your future mupdf.net applications. DLLmupdfcpp64.dll
contains the C library MuPDF wrapped with a C++ binding, andmupdfcsharp.dll
contains the C# bindings for MuPDF. -
Your system administration may determine to put these DLLs in a system folder or provide access to it via a
path
environment variable. If neither of this is the case, both files must be present in the projectbin
folder of your applications.
-
Create a C# application using Visual Studio.
-
Download and add MuPDF.NET package from NuGet. Refer to it via instruction
using MuPDF.NET;
in your C# source. -
Code your program and build it using the VS menu items
Build|Solution
. -
The generated executable of your app is the
.exe
file in thebin
folder.
MuPDF.NET is available under open-source AGPL (included in this repository as LICENSE
file) and commercial license agreements. If you determine you cannot meet the requirements of the AGPL, please contact Artifex for more information regarding a commercial license.