Could not load file or assembly ReachFramework

Hi Gembox Support Forum,

So I’m trying to get the snippet to run from your examples:

however when I try to print to my “Microsoft Print to PDF” printer I get the below error,
Could not load file or assembly 'ReachFramework

Hi Justin,

You need to enable WPF on your Console application.
For example, try this:

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

  <PropertyGroup>
    <OutputType>Exe</OutputType>
    <TargetFramework>net6.0-windows</TargetFramework>
    <UseWPF>true</UseWPF>
  </PropertyGroup>

  <ItemGroup>
    <PackageReference Include="GemBox.Document" Version="*" />
  </ItemGroup>

</Project>

Notice the “-windows” suffix on the targeted framework and “UseWPF” property.

Does this solve your issue?

Regards,
Mario

Thanks Mario, works perfectly.

Would it be possible to add a UNC path for the printer name as well?

Hi Justin,

What do you mean?
Anyway, you should try it out and check if it works for you.
Note that GemBox.Document does support using both local and network printers.

Regards,
Mario

I want to target a network printer, but there may be several from a server, so it would be easier if I could use a UNC path e.g. “\server\printer” instead of a “Printer name”, but Ill play around with it,
Thanks for the assistance Mario

Hi Justin,

Yes, that is how you should target your printer, use the full name with UNC path.

Regards,
Mario