SumatraPDFPrinter 1.0.5

There is a newer version of this package available.
See the version list below for details.
dotnet add package SumatraPDFPrinter --version 1.0.5
                    
NuGet\Install-Package SumatraPDFPrinter -Version 1.0.5
                    
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="SumatraPDFPrinter" Version="1.0.5" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="SumatraPDFPrinter" Version="1.0.5" />
                    
Directory.Packages.props
<PackageReference Include="SumatraPDFPrinter" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add SumatraPDFPrinter --version 1.0.5
                    
#r "nuget: SumatraPDFPrinter, 1.0.5"
                    
#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.
#:package SumatraPDFPrinter@1.0.5
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=SumatraPDFPrinter&version=1.0.5
                    
Install as a Cake Addin
#tool nuget:?package=SumatraPDFPrinter&version=1.0.5
                    
Install as a Cake Tool

SumatraPDFPrinter

SumatraPDFPrinter is a lightweight C# library that allows you to print PDF files using SumatraPDF, a fast and minimalistic PDF viewer. This library provides an easy way to send PDF documents to a specified printer without user interaction.

📌 Features

  • Print PDF files programmatically.
  • Supports specifying the target printer.
  • Uses SumatraPDF's command-line options for fast and silent printing.
  • Simple and lightweight, with minimal dependencies.
  • SumatraPDF is included with this library, so no separate download is required.

🛠 Installation

Add PdfPrinter.cs to your project.

🚀 Usage

using SumatraPDFPrinter;

string pdfPath = "C:\\path\\to\\yourfile.pdf";
string printerName = "Your Printer Name";

PdfPrinter.PrintPdf(pdfPath, printerName);

For asynchronous printing, use:

await Task.Run(() => PdfPrinter.PrintPdf(pdfPath, printerName));

⚙️ Configuration

Make sure that:

  • The provided PDF file path is valid.
  • The specified printer name is correct.

🛑 Troubleshooting

  • "PDF file not found!" → Verify the file path before printing.
  • Printing is stuck → Use Task.Run to avoid blocking the request.

📜 License

This library is licensed under the MIT License. Feel free to modify and use it in your projects.

💡 Contributions are welcome! If you find a bug or have an improvement, feel free to submit a pull request or open an issue.

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 was computed.  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.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net6.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
1.0.7 214 2/21/2025
1.0.6 116 2/21/2025
1.0.5 115 2/21/2025
1.0.4 115 2/21/2025
1.0.3 123 2/21/2025
1.0.2 117 2/21/2025
1.0.1 114 2/21/2025
1.0.0 124 2/21/2025