Print PDF byte array (.NET Core/Framework)
Printing PDF byte array using DynamicPDF Print Mangaer is simple and easy.
How to Print PDF Byte Array in C#
The following steps and sample code to print a PDF byte array using the Print Manager product.
Steps for printing PDF byte array
- Retrieve the byte array from PDF document.
- Create a
InputPdf
with the byte array. - Create a
PrintJob
with the Printer and the input pdf. - Print using the
PrintJob
object.
Sample Code - C#
byte[] pdfBytes = System.IO.File.ReadAllBytes("DocumentA.pdf");
InputPdf pdf = new InputPdf(pdfBytes);
PrintJob printJob = new PrintJob(Printer.Default, pdf);
printJob.Print();
Getting Started
NuGet Package
DynamicPDF PrintManager is available on NuGet and is part of the ceTe.DynamicPDF.Printing.NET
package. The easiest way to install the package is through the Visual Studio Package Manager. You can also download the package directly from NuGet.
NuGet Package ID: ceTe.DynamicPDF.Printing.NET
DynamicPDF PrintManager Information
More information can be found here: