Well, that's going to be difficult. Before everything else, a silent printing in general, is not what Browser is all about. A print dialog is thrown by the browser when a user selects a print option. Same thing if an application is trying to print using built into it conventional methods of printing - you get Print dialog. It gets even harder if you want to print PDF files silently. You will need to make sure that a file is available to print in case it's generated on the fly. The following code will print your PDF without dialogs to a selected (var printer) printer:
var WshShell = new ActiveXObject("WScript.Shell");
var fs = new ActiveXObject("Scripting.FileSystemObject");
var fi = "AcroRd32.exe /N /T " + '"c:\\temp\\' + "filename" + '" ' + printer;
WshShell.Run(fi, 0, false);
As you notice, the file is on the local system. Or you can try printing over the network.
This code will be a part of a JS function in your html wrapper. You will call this function from Flex using ExternalInterface.
AcroRd32.exe is an Adobe free PDF reader. I would suggest starting from the end - have a file on the local system and working on everything esle.
Thank you for the response. I know the requirements to print without the user viewing the PDF in a web browser goes against convention. But it is the client's requirement. I do not fell the solution you gave will work for me because this is a linux system. Plus, to call the application to print, you have to tell it the filename, which the user could see and gain direct access to if they view the HTML.
Just to make sure your term "silent" printing does not confuse things, the user will be clicking on a print icon and we will be initiating the print of the PDF and they can manage the print via the print dialog box that appears. There is nothing "silent" about it. We simply do not want them to see it, so the term "blind" print might be suitable.
That said, someone suggested that StageView could be used to load the PDF, then place the stage into a PrintJob and print it. However, that is an AIR implementation and this is a we application, so with my limited understanding, that will not work.
As you have mentioned, yuo are running it as a web application. So, no, you cannot load PDF into the app. Plus, I am positive that the print quality and stuff will not be as a good as printing by using native to PDF engines.
File name was an example. You can use variables for that. Unfortunately, I dont know if you can do scripting on Linux system.