Skip to content

Latest commit

 

History

History
26 lines (20 loc) · 1.33 KB

README.md

File metadata and controls

26 lines (20 loc) · 1.33 KB

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);