Error initializing Print Options, error code: 1346

Skip Navigation LinksHome  /  Support  /  Forums  /  DynamicPDF PrintManager for .NET (v4)  /  Error initializing Print Options, error code: 1346

DynamicPDF PrintManager for .NET (v4) Forum

Hi,

We get Error initializing Print Options to print to a networked printer;

PrintJob printJob = new PrintJob();
printJob.Print("printserver\\printer", pdfFileName);

The program have been tested on local printers.

Any help would be appreciated,

Tony

Posted by a ceTe Software moderator
Hello,

The error code 1346 that is returned by the PrintManager is actually a Windows exception that PrintManager received while trying to create the print job. The error code 1346 points to an impersonation issue. Details on the error code can be found here. It is likely due to a permissions issue in the application where it is unable to access the printer. If you are using web application, there could also be an application level setting (in IIS settings or in web.config) that could be causing this error.

Also you are passing the printer name and the file path in the Print method of PrintJob. You will need to create the PrintJob by passing the printer name and PDF file path and then print it. Below is the code sample.

    string pdfFileName = "Input PDF file path";
    PrintJob printJob = new PrintJob((@"\\servername\printername", pdfFileName);
    printJob.Print();

Thanks,
ceTe Software Support Team
Hi,

The  identity impersonate="true" in my web config causing the error 1346. After change it to  impersonate=false, the error gone.

However, the printing still cannot complete, it simply hangs there!

I've posted the details in the other thread. So you can close this one.

All times are US Eastern Standard time. The time now is 7:17 PM.