DynamicPDF.Printing.NET Printing Issues For Certain Printers

Skip Navigation LinksHome  /  Support  /  Forums  /  DynamicPDF PrintManager for .NET (v4)  /  DynamicPDF.Printing.NET Printing Issues For Certain Printers

DynamicPDF PrintManager for .NET (v4) Forum


We are currently running a .NET Core 3.1 Service Worker application that processes some documents and ultimately prints them out using the ceTe.DynamicPDF.Printing.NET NuGet library v.4.17.0. However, we are running into some issues with our service throwing the below exception when attempting to initialize the PrintJob() for some trouble printers:

-------------------- LOG --------------------
2021-05-06 13:17:57.848 -06:00 [ERR] Failed Printing - Printer: CW PGPCORP_TP6, File: E:\PGPTitle\Data\FlexiCapture\Export\TX-207835_DEEDCERT_202105DD_131757.pdf - Error initializing print options. Error code:0
ceTe.DynamicPDF.Printing.PrintingException: Error initializing print options. Error code:0
   at ceTe.DynamicPDF.Printing.PrintJobPrintOptions..ctor(PrintJob A_0)
   at ceTe.DynamicPDF.Printing.PrintJob.a()
   at ceTe.DynamicPDF.Printing.PrintJob..ctor(String printerName, InputPdf inputPdf)
   at FlexiCaptureService.Services.ExportService.Print(String filePath, String printerName, String printerServer) in D:\21\_work\358\s\FlexiCaptureService\Services\Export\ExportService.cs:line 183
   at FlexiCaptureService.Services.ExportService.ExportBatches() in D:\21\_work\358\s\FlexiCaptureService\Services\Export\ExportService.cs:line 136

-------------------- Printer information --------------------
Brother HL-L6400DW series
Firmware Version
MAIN - 1.82
SUB1 - 1.63

-------------------- Code Snippet --------------------
using (var pdf = new InputPdf(filePath))
using (var job = new PrintJob(@$"\\{printerServer}\{printerName}", pdf))
    var paperSource = job.Printer.PaperSources.Automatic;
    if (paperSource != null)
        job.PrintOptions.PaperSource = paperSource;
        Console.WriteLine($"Printer {printerName} does not support automatic tray selection.");


What exactly does "Error initializing print options. Error code:0" mean and what is the Error code:0?
We would like some more information on this specific error to troubleshoot and remediate this problem for our users.

Important notes:
We have other printers on the network that are the same brand, model, and version that are working.
The above test snippet works when running the code locally through a console application.
Users can print to the problem printers locally (outside of the service application) works fine.

Please let me know if there are any questions and or if I can provide any additional information.

Thank you in advance,
Posted by a ceTe Software moderator

DynamicPDF PrintManager product uses the Win32 API for printing PDFs to a specified printer. The error code 0 usually indicates that the user account under which the application is running does not have permission to access the printer settings.

ceTe Software Support Team

All times are US Eastern Standard time. The time now is 2:51 PM.