473,508 Members | 2,265 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

print pdf via website

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

Nov 16 '05 #1
3 1642
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"
Nov 16 '05 #2
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

"Michael Voss" <mi**********@lvrREMOVE.deCAPS> wrote in message
news:40b71289$1@news...
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"

Nov 16 '05 #3
On Fri, 28 May 2004 12:45:29 +0200, "Roel" <vd*****@pandora.be> wrote:
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.
Nov 16 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
4653
by: Rob McLennan - ZETLAND | last post by:
Hi, I have set up an external stylesheet, named "print.css", to format the style of all pages printed from my company's website. I've been previewing my changes to the stylesheet by doing...
4
2343
by: rom | last post by:
I need to print a html table when the user clicks on a key. the problem is that i don't want the printer dialog box to appear. i guess this is impossible in javascript so i think to create an...
3
2359
by: Nevets Steprock | last post by:
I have a webpage that prints nicely when the layout is switched from portrait to landscape. Many of my site users have mistakenly printed it without making the change to their settings and end up...
6
3370
by: moony marouane | last post by:
Hi Everybody I have a problem opening a file with ADODB.Stream when <HTML> exists on the same page here is the code I use : =================================== <HTML> <%
1
2788
by: ccherlet | last post by:
I'm trying to create a print link that sends the page to the printer without opening the print dialog box on the browser. I know that window.print() will open the print dialog and then the user...
1
8611
by: Kbalz | last post by:
Having a really hard time finding solid examples on deploying a CR .NET applcation on my intranet. I'll explain what I've done so far, and toward the bottom is where I can't print using the report...
4
3171
by: =?Utf-8?B?UGF1bCBCdXp6YSwgb2xkc3RlciB1c2luZyBuZXcg | last post by:
I have developed a web-based inventory system for my estate jewelry business using ASP.Net 2.0 and Microsoft SQLServer. The inventory database is also the basis of my website...
1
1227
by: Avradita | last post by:
Hello to all, I have a website where I would like to place a print button so that the user from his/her end can take a print out of any particular page. I know that this can be done with the help...
2
14253
by: toronto | last post by:
Seasons Greetings Everyone! I want to use JavaScript's event object to detect whether someone has pressed the 'PrintScreen' key to screenshot, via the Windows Clipboard, and to print website...
3
2922
by: rajkumarpb | last post by:
Hi friends, I am new to this forum...But not for programming...I want a Print CSS File to be added in my page..OK.... Here is the page and i want you friends to help me create the CSS File...
0
7231
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7132
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7336
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
7063
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7504
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
5059
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4720
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3211
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
432
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.