GemBox Support Forum

Print PDF on Worker Services

I’m trying to print in a .NET Core 3.1 Worker Service application, but I get an exception that the ReachFramework assembly could not be loaded.

Is it possible to print in a .NET Core 3.1 application or do I need to target a .NET Framework?

Hi Jochen,

GemBox.Pdf uses WPF (more specifically the System.Printing namespace) for printing PDF files, see this related .NET Core section.

So, in order to print on .NET Core 3.1, you’ll need to enable WPF.
For example, something like this:

<Project Sdk="Microsoft.NET.Sdk.Worker">

    <FrameworkReference Include="Microsoft.WindowsDesktop.App" />
    <PackageReference Include="GemBox.Pdf" Version="*" />
    <PackageReference Include="Microsoft.Extensions.Hosting" Version="3.1.4" />

I hope this helps.


Hi Mario,

In the documentation, I was looking at Print PDF files, because I did not need the creation.

With your sample, I was able to get it working, but I also had to add the following: