dotnet / wpf

WPF is a .NET Core UI framework for building Windows desktop applications.
MIT License
7.11k stars 1.17k forks source link

System.Printing Support #871

Closed shaggygi closed 5 years ago

shaggygi commented 5 years ago

This was created based on a discussion from https://github.com/dotnet/corefx/issues/37978

I was trying to port an API to .NET Core that uses System.Printing PrintServer and related. I came across this doc and have the impression System.Printing is supported.

I was informed (from issue link above) this is part of WPF and can be use by creating a dotnet new wpf. However, I would like to use as a Class Library even if it must use the Win Compatibility package and Windows only.

We have many APIs to create/print labels that call the System.Printing APIs. It would be nice to continue the same approach using WPF with .NET Core v3 and beyond.

Thanks in advance for any help. It will be appreciated.

dsplaisted commented 5 years ago

You can add the following to a .NET Core 3.0 class library project in order to access System.Printing:

<ItemGroup>
  <FrameworkReference Include="Microsoft.WindowsDesktop.App" />
</ItemGroup>
shaggygi commented 5 years ago

Thanks team for all the help. I was able to change one of our label and printer APIs to a .NET Core Class Library project and now works similar to .NET (full framework).