I'm trying to print from silverlight without a print dialog and for that I'm using System.Runtime.InteropServices.Automation;
Right now I'm creating a temporary txt file that contain the text to send to printer.
using (dynamic fso = AutomationFactory.CreateObject(@"Scripting.FileSystemObject"))
{
dynamic file = fso.CreateTextFile(cFileName, true);
file.Write(printText);
file.Close();
}
After that I'm using shell.Aplication to print that document.
dynamic shell = AutomationFactory.CreateObject("Shell.Application");
shell.ShellExecute(cFileName, "", "", "print", 1);
The question is, how can a print directly to printer without a temporary txt file?
Don't forget that I'm using Silverlight 4 out of browser and with elevated trust.