print pdf via website

R

Roel

Hello

I try to pint a pdf from a .net webapplication. Therefore I use GhostScript.

When I execute the following line via "start - run", the pdf is printed
correctly:
c:\gs\gs8.14\bin\gswin32c.exe -dNOPAUSE -dBATCH -sDEVICE=ljet4 -sOutputFile=
"%printer%\\SRV01\bezvntprt02\" c:\208.pdf

My code in the appication:

proc.StartInfo.FileName = "C:\\gs\\gs8.14\\bin\\gswin32.exe ";
proc.StartInfo.Arguments = "-dNOPAUSE " +
"-dBATCH " +
"-sDEVICE=ljet4 " +
"-sOutputFile=\"%printer%\\\\SRV01\\bezvntprt02\" " +
"c:\\208.pdf";
proc.StartInfo.UseShellExecute = false;
proc.StartInfo.RedirectStandardOutput = true;
proc.Start();

But it won't work...
NOTE1: SRV01 = printserver
NOTE2 bezvntprt02 = printername

Does anybody knows what I'm doing wrong or has another solution ?

Regards
Roel
 
M

Michael Voss

Hi !

Not knowing any useful thing about Ghostscript, but only comparing the
argument strings from command line and your c#-code,
"%printer%\\SRV01\bezvntprt02\"
\"%printer%\\\\SRV01\\bezvntprt02\"
^
------------------------------------|

shouldn't there be two additional '\\' ?
Unescaping the c#-code would lead to

"%printer%\\SRV01\bezvntprt02"
 
R

Roel

That 's not the problem, I think. The command I execute via run is
"%printer%\\SRV01\bezvntprt02" I also create this command in my C-sharp
code.

But maybe the problem has something to do with rights.

Let me explain it:

When I execute the command via 'Run', the document is printed. When I try to
execute the same command via asp.net, the document is not printed. Maybe it
has something to do with the user that actually prints the document ? Isn't
that different in both cases ???



Regards and many thx for your input !

Roel
 
G

Greg Miller

When I execute the command via 'Run', the document is printed. When I try to
execute the same command via asp.net, the document is not printed. Maybe it
has something to do with the user that actually prints the document ? Isn't
that different in both cases ???

The standard method of debugging any permissions issue is to
grant admin rights to the web service. Or convert that part of the
program to a console C# app and run it under your account. If it
still doesn't work, it's not a permissions problem. If it does work,
then you get to start the fun process of determining what access you
need.
 

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

Similar Threads


Top