Installation
Add the NexPDF NuGet package to a .NET project and make the native engine library available.
Get the native library
Download the archive for your platform from the v1.1.0 release:
| Platform | Archive | Library |
|---|---|---|
| Linux x64 | nexpdf-ffi-1.1.0-linux-x64.tar.gz | lib/libnexpdf_ffi.so |
| Linux arm64 | nexpdf-ffi-1.1.0-linux-arm64.tar.gz | lib/libnexpdf_ffi.so |
| macOS | nexpdf-ffi-1.1.0-macos-universal.tar.gz | lib/libnexpdf_ffi.dylib |
| Windows x64 | nexpdf-ffi-1.1.0-windows-x64.zip | lib/nexpdf_ffi.dll |
Put the library where .NET finds it
At run time .NET loads nexpdf_ffi from the application folder or the system library path
(LD_LIBRARY_PATH, DYLD_LIBRARY_PATH, PATH). The simplest way is to copy it to the output
folder:
<ItemGroup>
<None Include="native/libnexpdf_ffi.so" CopyToOutputDirectory="PreserveNewest" />
</ItemGroup>Check the installation
Console.WriteLine(Nexdevit.NexPdf.NexPdfSdk.Version);A package that carries the engine
NuGet copies the right native library next to the application when the package holds one per
runtime identifier under runtimes/<rid>/native/. To build such a package from the SDK source, put
the libraries there and pack:
dotnet pack nexpdf-dotnet/NexPdf.csproj -c ReleaseThe macOS release library is universal, so the same file goes in both osx- folders.
Docker
FROM mcr.microsoft.com/dotnet/aspnet:8.0
ADD https://github.com/nexdevit/nexpdf-dotnet/releases/download/v1.1.0/nexpdf-ffi-1.1.0-linux-x64.tar.gz /tmp/
RUN tar -xzf /tmp/nexpdf-ffi-1.1.0-linux-x64.tar.gz -C /opt
ENV LD_LIBRARY_PATH=/opt/nexpdf-ffi-1.1.0-linux-x64/lib
COPY publish/ /app/
WORKDIR /app
ENTRYPOINT ["dotnet", "MyApp.dll"]