I am developing a Web API that is deployed in IIS 8 on Windows Server 2012 R2. It requires that documents be printed from the Server to a network printer.
I am developing on a RDP session which has a redirected printer, this printer is also set as my default printer.
I have created a dummy proof of concept as a Console Application to userstand what is necessary to make this work.
The dummy console uses the following code to find printers
var ps = new PrinterSettings();
foreach(var p in PrinterSettings.InstalledPrinters)
{
var name = p as string;
Console.WriteLine(name);
}
When running as a Console application this picks up the default redirected printer and works.
I have moved this code to the Web API and done the follwoing
- set the Application Pool of the site to run under my account (for test purposes)
- Installed the internet Printing Role
- Installed the Internet Print Client feature
After doing this the default printer is no longer in the list of installed printers and there is no default available.
What additional permissions/changes do I have to make in order that the IIS hosted site can see the redirected printer?