PrinterSetting 2.3.1

dotnet add package PrinterSetting --version 2.3.1                
NuGet\Install-Package PrinterSetting -Version 2.3.1                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="PrinterSetting" Version="2.3.1" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add PrinterSetting --version 2.3.1                
#r "nuget: PrinterSetting, 2.3.1"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install PrinterSetting as a Cake Addin
#addin nuget:?package=PrinterSetting&version=2.3.1

// Install PrinterSetting as a Cake Tool
#tool nuget:?package=PrinterSetting&version=2.3.1                

PrinterSetting

Nuget downloads NuGet GitHub license
This is a library for changing the output size and orientation of printer.

Ver2.3.1.0 -Added .NET8 to the target framework.

Ver2.3.0.0
-Removed dependencies on System.Drawing.Common and System.Management. And Extensions methods now use Win32API.

Ver2.2.1.0
-Removed .net5.0 from target framework -Referenced packages changed and reorganized

Ver2.2.0.0
-Changed target framework from 4.7 to 4.7.2
-Referenced packages changed and reorganized

Ver2.1.0.0
-Changed Win32API from ANSI to UNICODE.
-Added Extension for enumerating printers and setting/getting default printers.

Install

PM> Install-Package PrinterSetting

Getting Started

using PrinterSetting;
var printer = new Printer("PrinterName");
printer.SetPageInfo(PageOrientation.Portrait, PaperSize.A5);

foreach (var p in Extensions.EnumeratePrinterName())
{
    Console.WriteLine(p);
}
Console.WriteLine(Extensions.GetDefaultPrinterName());
var result = Extensions.SetDefaultPrinter("PrinterName");
Console.WriteLine(Extensions.GetDefaultPrinterName());
.NET5 Or Greater
[assembly: SupportedOSPlatform("windows")]  //Put it above the namespace.
or
[SupportedOSPlatform("windows")]  //Put it above the class or method.
Product Compatible and additional computed target framework versions.
.NET net6.0 is compatible.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
.NET Framework net472 is compatible.  net48 is compatible.  net481 was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • .NETFramework 4.7.2

    • No dependencies.
  • .NETFramework 4.8

    • No dependencies.
  • net6.0

    • No dependencies.
  • net8.0

    • No dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
2.3.1 245 12/15/2023
2.3.0 372 1/26/2023
2.2.1 330 1/4/2023
2.2.0 480 3/27/2022
2.1.0 297 1/6/2022
1.0.0 436 12/14/2021