Installation |
ExpertPdf Anywhere is installed from NuGet. There is no installer, nothing to register on the server and no system package to install on Linux: the packages copy everything the library needs next to your application when it builds and when it is published.
Package | Content |
|---|---|
ExpertPdf.Anywhere | The library (ExpertPdf.Anywhere.dll), AnyCPU, for .NET 11, .NET 10, .NET 9, .NET 8 and .NET Standard 2.0 (.NET Framework 4.6.1 and later). |
ExpertPdf.Anywhere.Native.win-x64, .win-x86, .linux-x64, .linux-arm64, .osx-arm64 | The native engines for one platform: the Chromium engine (HTML to PDF, HTML to image) in the Chromium-CEF-154.0.28 folder and the PDF tool ExpertPdf.Tools (PDF to text, PDF to image, image extraction). |
ExpertPdf.Anywhere.Windows, .Linux, .Linux.Arm64, .MacOS | Platform packages: the library and the native engines of one platform (Windows x64, Linux x64, Linux ARM64, macOS on Apple Silicon) in a single reference. |
ExpertPdf.Anywhere.Fonts | Google's Noto fonts for every script, copied to a fonts folder next to the application on Linux and macOS. For hosts with no fonts installed: Docker images, AWS Lambda, Azure App Service on Linux. |
The simplest setup is one platform package:
dotnet add package ExpertPdf.Anywhere.Windows
or the library and the native package of your runtime:
dotnet add package ExpertPdf.Anywhere dotnet add package ExpertPdf.Anywhere.Native.linux-x64
Every native package copies its engine to the same Chromium-CEF-154.0.28 folder, so a project references the native package of the platform it runs on, not several of them. To build on one platform and publish for another, choose the package by the runtime identifier:
<ItemGroup> <PackageReference Include="ExpertPdf.Anywhere" Version="22.0.0" /> <PackageReference Include="ExpertPdf.Anywhere.Native.win-x64" Version="22.0.0" Condition="'$(RuntimeIdentifier)' != 'linux-x64'" /> <PackageReference Include="ExpertPdf.Anywhere.Native.linux-x64" Version="22.0.0" Condition="'$(RuntimeIdentifier)' == 'linux-x64'" /> </ItemGroup>
Then dotnet publish -r linux-x64 deploys the Linux engine and a build on the development machine the Windows one. The engines are separate processes or a native library loaded into your process (see Chromium Engine); the managed package itself is the same on every platform.
using ExpertPdf.Anywhere.HtmlToPdf; PdfConverter converter = new PdfConverter(); // converter.LicenseKey = "your license key"; converter.PdfDocumentOptions.PdfPageSize = PdfPageSize.A4; converter.SavePdfFromUrlToFile("https://www.html-to-pdf.info", "page.pdf");
Without a license key the library runs in evaluation mode and marks the documents it creates. See Licensing.
The samples download has, for Windows, Linux and macOS, an ASP.NET Core web site with a page for every feature and console applications in C# and VB.NET for the HTML to PDF converter, merge, split, security, PDF to text, PDF to image and image extraction. Each folder has a solution that restores the packages from NuGet.