problem with ProcessStartInfo

  • Thread starter Thread starter Michelle Mabelle
  • Start date Start date
M

Michelle Mabelle

I have the code below. It will open and print the pdf file (test.pdf) to the
printer.

ProcessStartInfo startInfo = new ProcessStartInfo();
startInfo.UseShellExecute = true;
startInfo.Verb = "Print";
startInfo.CreateNoWindow = true;
startInfo.WindowStyle = ProcessWindowStyle.Minimized;
startInfo.FileName = @"E:\\barcode\test.pdf";
Process p = new Process();
p.StartInfo = startInfo;
p.Start();

It works well on my local test machine. Once I copied it to the server, it
will not print or open the pdf file.
Anybody can help?
 
on the server there is no profile setup for asp.net (on you dev box it runs
as you). this means no default printer. you will need to specify the printer.

-- bruce (sqlwork.com)
 
Thank you Bruce!
I am not sure how to setup profile for asp.net...
Also, I specified printer on another part of the code as below:

ProcessStartInfo startInfo = new ProcessStartInfo();
startInfo.UseShellExecute = true;
startInfo.Verb = "Printto";
startInfo.Arguments = @"\\UTzhangM\ZebraTLP";
startInfo.CreateNoWindow = true;
startInfo.WindowStyle = ProcessWindowStyle.Minimized;
startInfo.FileName = @"E:\\barcode\test.pdf";
Process p = new Process();
p.StartInfo = startInfo;
p.Start();
 
Back
Top