Skip to main content

Print PDF from Bytearray

Version: 4.0

Print PDFs From Byte Arrays

Printing a PDF held in a byte array is a breeze using DynamicPDF Print Manager for .NET. The following C# example shows you how.

How to Print PDF from a Byte Array​

The following steps and C# sample code to print a PDF from a byte array using DynamicPDF PrintManager for .NET.

Steps for printing PDF byte array​

  1. Retrieve the byte array from PDF document.
  2. Create a InputPdf with the byte array.
  3. Create a PrintJob with the Printer and the input pdf.
  4. 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();

GitHub Project​

Examples are provided in C# and VB.NET. Clone or view the example project at GitHub. This example contained on this page are in the following files.

View source on GitHub: DynamicPDF PrintManager Examples

Getting Started​

Get started easily by installing DynamicPDF PrintManager for .NET through NuGet or manually. Then, refer to the documentation for more information on using and purchasing.

NuGet Package​

The easiest way to install DynamicPDF Rasterizer for .NET is by obtaining the NuGet package using Visual Studio's Package Manager. You can also obtain the NuGet package by downloading it directly. Refer to the installation documentation for more information.

Get ceTe.DynamicPDF.Printing.NET from NuGet

DynamicPDF PrintManager Information​

More information can be found here:

Documentation version