Open-Source PdfiumPrinter
For this to work will be needed one of the following libraries NuGet packages: PdfiumViewer.Native.x86_64.v8-xfa PdfiumViewer.Native.x86.v8-xfa PdfiumViewer.Native.x86.no_v8-no_xfa PdfiumViewer.Native.x86_64.no_v8-no_xfa
Usage: var printer = new PdfPrinter("Microsoft Print to PDF"); printer.Print(printFile);
A small library for printing pdf files. This was adapted to netstandard from PdfiumViewer using Pdfium by google
To install PdfiumPrinter, run the following command in the Package Manager Console:
PM> Install-Package PdfiumPrinter
Additionally, you'll have to install ONE of the following NuGet Packages(based on your needs): PdfiumViewer.Native.x86_64.v8-xfa PdfiumViewer.Native.x86.v8-xfa PdfiumViewer.Native.x86.no_v8-no_xfa PdfiumViewer.Native.x86_64.no_v8-no_xfa
var printerName = "Microsoft Print to PDF"; //You can use your own printer;
var printer = new PdfPrinter(printerName);
var printFile = "somePdf.pdf"; //The path to the pdf which needs to be printed;
printer.Print(printFile);
Additionally, you can specify the number of copies, or a stream for a pdf file.
You can find the documentation and code samples here: https://github.com/sandrohanea/PdfiumPrinter/
Apache-2.0 https://licenses.nuget.org/Apache-2.0