Skip to content

lvitti/SumatraPDFWrapper

 
 

Repository files navigation

SumatraPDFWarpper

License NuGet Build Status

The SumatraPDFWarpper project Allows to print PDF files uses SumatraPDF util. The package contains SumatraPDF.exe and copys it to the output folder before build event. Also it provides SumatraPDFWarpper class that runs SumatraPDF.exe inside of a "Print" method in a separate process with default timeout 1 minute (the timeout can be overrited by 3rd argument).

Sample usage:

var filePath = "c:\path\to\pdf\file.pdf";
var printerName = "Vendor Color Printer Name";
var printWrapper = new SumatraPDFWarpper();
printWrapper.Print(filePath, printerName);

or

var filePath = "c:\path\to\pdf\file.pdf";
var networkPrinterName = "\\myprintserver\printer1";
var printTimeout = new TimeSpan(0, 30, 0);
var printWrapper = new SumatraPDFWarpper();
printWrapper.Print(filePath, networkPrinterName, printTimeout);

About

.Net Wrapper over SumatraPDF CLI

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C# 100.0%