problem with ProcessStartInfo

  • Thread starter Michelle Mabelle
  • 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?
 
B

bruce barker

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)
 
M

Michelle Mabelle

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();
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,770
Messages
2,569,583
Members
45,075
Latest member
MakersCBDBloodSupport

Latest Threads

Top