C
Confused But Happy
Hi All
Using Adobe 9 version 9.3.0, Visual studio 2008/C#
I have a wee problem.
Due to the restrictions of printing from (a .net browser application) the browser I have created a Windows Watch Application to watch a directory (running it locally at the moment but it will run on the IIS web server).
When a PDF document arrives in the watch folder (created by the .net web app using iTextSharp) the watch application will pick up the PDF document andsend it to the chosen printer using the printer value (that will only change if there is a problem with the printer) selected from a Combobox in the watch application
The problems I am having are
1. The Print Dialogue in Adobe Acrobat always picks up my Default Printer.
2. The print actually does not appear to be going anywhere (not even my default printer).
What is actually happening is as follows
1. The watch application detects the new pdf file
2. The Print Dialogue appears with my default printer selected and the correct document previewed.
3. The Print Dialogue disappears (with no intervention from me) and there is no resulting print ??????
4. If I pause the application just before the Kill command I can hit the OKbutton on the print dialogue and it prints to the Default printer (I get 2copies for some reason).
The values of the vars are as follows
fullFileName = "C:\\Inetpub\\wwwroot\\ZebraBackup\\ZebraBackup\\MyPDFOutputs\\S134463.pdf"
selectedPrinter = "\\\\dun-server6\\Finance Canon"
strArguments = "/t
\" C:\\Inetpub\\wwwroot\\ZebraBackup\\ZebraBackup\\MyPDFOutputs\\S134463.pdf\" \" \\\\dun-server6\\Finance Canon\" "
The Print Dialogue appears with my default printer selected
\\Dun-Server6\HR Printer 3015
"\\\\dun-server6\\Finance Canon\" this is the selected printer from the combobox
Can anyone please assist and tell me where I am going wrong as I feel I am going nuts.
Please see my code below
Many thanks in advance for any assistance offered
Regards
Iain (confused but happy)
ProcessStartInfo startInfo = new ProcessStartInfo("AcroRd32.exe");
string strArguments = "/t \"" + fullFileName + "\" \"" +
selectedPrinter + "\"";
Process proc = new Process();
startInfo.WindowStyle = ProcessWindowStyle.Hidden;
startInfo.FileName = fullFileName;
startInfo.Verb = "print";
startInfo.CreateNoWindow = false;
startInfo.ErrorDialog = true;
startInfo.Arguments = strArguments;
startInfo.UseShellExecute = true;
proc.StartInfo = startInfo;
proc.Start();
proc.WaitForExit(5000);
if (proc.HasExited == false)
{
proc.Kill();
}
Using Adobe 9 version 9.3.0, Visual studio 2008/C#
I have a wee problem.
Due to the restrictions of printing from (a .net browser application) the browser I have created a Windows Watch Application to watch a directory (running it locally at the moment but it will run on the IIS web server).
When a PDF document arrives in the watch folder (created by the .net web app using iTextSharp) the watch application will pick up the PDF document andsend it to the chosen printer using the printer value (that will only change if there is a problem with the printer) selected from a Combobox in the watch application
The problems I am having are
1. The Print Dialogue in Adobe Acrobat always picks up my Default Printer.
2. The print actually does not appear to be going anywhere (not even my default printer).
What is actually happening is as follows
1. The watch application detects the new pdf file
2. The Print Dialogue appears with my default printer selected and the correct document previewed.
3. The Print Dialogue disappears (with no intervention from me) and there is no resulting print ??????
4. If I pause the application just before the Kill command I can hit the OKbutton on the print dialogue and it prints to the Default printer (I get 2copies for some reason).
The values of the vars are as follows
fullFileName = "C:\\Inetpub\\wwwroot\\ZebraBackup\\ZebraBackup\\MyPDFOutputs\\S134463.pdf"
selectedPrinter = "\\\\dun-server6\\Finance Canon"
strArguments = "/t
\" C:\\Inetpub\\wwwroot\\ZebraBackup\\ZebraBackup\\MyPDFOutputs\\S134463.pdf\" \" \\\\dun-server6\\Finance Canon\" "
The Print Dialogue appears with my default printer selected
\\Dun-Server6\HR Printer 3015
"\\\\dun-server6\\Finance Canon\" this is the selected printer from the combobox
Can anyone please assist and tell me where I am going wrong as I feel I am going nuts.
Please see my code below
Many thanks in advance for any assistance offered
Regards
Iain (confused but happy)
ProcessStartInfo startInfo = new ProcessStartInfo("AcroRd32.exe");
string strArguments = "/t \"" + fullFileName + "\" \"" +
selectedPrinter + "\"";
Process proc = new Process();
startInfo.WindowStyle = ProcessWindowStyle.Hidden;
startInfo.FileName = fullFileName;
startInfo.Verb = "print";
startInfo.CreateNoWindow = false;
startInfo.ErrorDialog = true;
startInfo.Arguments = strArguments;
startInfo.UseShellExecute = true;
proc.StartInfo = startInfo;
proc.Start();
proc.WaitForExit(5000);
if (proc.HasExited == false)
{
proc.Kill();
}