Hi!
I am facing some issues getting the default printer at my client's location. My client has a default printer attached at his local laptop.
Now, I have hosted an ASP.NET application with the licensed copy of Print Manager 32-bit. I have used the below code for this:
PrintJob printJob = new PrintJob(Printer.Default, Server.MapPath("myhiddenfilepath"));
printJob.Print();
But this gives an error : 'Could not load default printer'
My basic question is does this code try to find the server's printer where the site is hosted or the client's printer means the desktop form where the site is being called?
Also kindly help with the above error.
Regarding PrintManager
Re: Regarding PrintManager
Support · Jun 30, 2015Hello,
PrintManager is not capable of printing to any printers connected to the client desktop from where the site is being called. It is a server side component and can only print to the printers available to the web server where the site is hosted.
The ASP.NET code runs on the server so when you specify Printer.Default in your ASP.NET code the PrintManager tries to find the printers that are available on the server side. In your case, if a default printer is not available it will throw the error you are seeing. On the server, the printers are typically installed and configured for each account and a default printer might be a different printer for the ASP.NET user account or it might not have been configured correctly. If you want to print on the server side, please make sure that the printer is configured correctly for the ASP.NET account so the application can access it for printing. Also using PrintManager you can read the installed printers installed using Printer.GetLocalPrinter()
method and also use the Printer.Default.Name property to retrieve the printer name. Using the GetLocalPrinter() you will be able to see what printers are installed for the internet user account and pick the correct printer to print to.
Thanks,
ceTe Software Support Team.