473,507 Members | 12,744 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Printing PDF from Process.Start( , ) without user prompt

mg
The following .exe and its parameters work correctly from the command prompt
(it prints x.pdf without prompting the user.

acrord32.exe /t "c:\exportfiles\x.pdf" "HP LaserJet 3300 Series PCL 6" "HP
LaserJet 3300 Series PCL" "DOT4_001"

But, I have not been able to use the exe and its parameters as arguments #1
& #2 in System.Diagnostics.Process.Start( arg1 , arg2) when run in the code
behind of a Visual Studio WebForm

I have given ASP.NET all permissions, so commands like
System.Diagnostics.Process.Start("c:\\windows\\sys tem32\\notepad.exe","c:\\x.txt"); work fine
Nov 18 '05 #1
6 3059
You want to run this on the Server? Do you get an error? Define "have not
been able"

Jeff
"mg" <mg@discussions.microsoft.com> wrote in message
news:58**********************************@microsof t.com...
The following .exe and its parameters work correctly from the command prompt (it prints x.pdf without prompting the user.

acrord32.exe /t "c:\exportfiles\x.pdf" "HP LaserJet 3300 Series PCL 6" "HP
LaserJet 3300 Series PCL" "DOT4_001"

But, I have not been able to use the exe and its parameters as arguments #1 & #2 in System.Diagnostics.Process.Start( arg1 , arg2) when run in the code behind of a Visual Studio WebForm

I have given ASP.NET all permissions, so commands like
System.Diagnostics.Process.Start("c:\\windows\\sys tem32\\notepad.exe","c:\\x
..txt"); work fine

Nov 18 '05 #2
mg
> You want to run this on the Server?

Yes. But for now I'd be happy to get it running on my desktop using Visual
Studio .NET
Do you get an error?

Yes:
Unhandled exception at 0x65697265 in AcroRd32.exe: 0xC0000005: Access
violation reading location 0x65697265.
Define "have not been able"
The file x.pdf is not printed.
"Jeff Dillon" wrote:
You want to run this on the Server? Do you get an error? Define "have not
been able"

Jeff
"mg" <mg@discussions.microsoft.com> wrote in message
news:58**********************************@microsof t.com...
The following .exe and its parameters work correctly from the command

prompt
(it prints x.pdf without prompting the user.

acrord32.exe /t "c:\exportfiles\x.pdf" "HP LaserJet 3300 Series PCL 6" "HP
LaserJet 3300 Series PCL" "DOT4_001"

But, I have not been able to use the exe and its parameters as arguments

#1
& #2 in System.Diagnostics.Process.Start( arg1 , arg2) when run in the

code
behind of a Visual Studio WebForm

I have given ASP.NET all permissions, so commands like

System.Diagnostics.Process.Start("c:\\windows\\sys tem32\\notepad.exe","c:\\x
..txt"); work fine


Nov 18 '05 #3
Show the exact code that you are using, and I'll try it here.

Just so you know, clients will be printing on the server via this technique,
not from their desktop. How does the paper then get from the printer near
the server, to the client sitting at their desk?

Jeff

"mg" <mg@discussions.microsoft.com> wrote in message
news:9E**********************************@microsof t.com...
You want to run this on the Server?


Yes. But for now I'd be happy to get it running on my desktop using Visual
Studio .NET
Do you get an error?
Yes:
Unhandled exception at 0x65697265 in AcroRd32.exe: 0xC0000005: Access
violation reading location 0x65697265.
Define "have not been able"


The file x.pdf is not printed.
"Jeff Dillon" wrote:
You want to run this on the Server? Do you get an error? Define "have

not been able"

Jeff
"mg" <mg@discussions.microsoft.com> wrote in message
news:58**********************************@microsof t.com...
The following .exe and its parameters work correctly from the command

prompt
(it prints x.pdf without prompting the user.

acrord32.exe /t "c:\exportfiles\x.pdf" "HP LaserJet 3300 Series PCL 6" "HP LaserJet 3300 Series PCL" "DOT4_001"

But, I have not been able to use the exe and its parameters as
arguments #1
& #2 in System.Diagnostics.Process.Start( arg1 , arg2) when run in
the code
behind of a Visual Studio WebForm

I have given ASP.NET all permissions, so commands like

System.Diagnostics.Process.Start("c:\\windows\\sys tem32\\notepad.exe","c:\\x ..txt"); work fine


Nov 18 '05 #4
mg
Show the exact code that you are using, and I'll try it here.
System.Diagnostics.Process.Start("c:\\program files\\adobe\\acrobat
6.0\\reader\\acrord32.exe",@"/t c:\exportfiles\d.pdf 'HP LaserJet 3300 Series
PCL 6' 'HP LaserJet 3300 Series PCL' 'DOT4_001'");
How does the paper then get from the printer near the server, to the client sitting at their desk?

It doesn't. This code prints the pdf file on a printer named HP LaserJet
3300 Series PCL 6 (or any other printer name I choose)

=======================

Unless you know how to give the ASP.NET worker process the permissions
(that's a whole nother story), this code won't actually print. But, if this
code were to run without error at your site, chances are it would also print
here, where the ASP.NET worker process has the permissions it needs to do so.

It appears

"Jeff Dillon" wrote:
Show the exact code that you are using, and I'll try it here.

Just so you know, clients will be printing on the server via this technique,
not from their desktop. How does the paper then get from the printer near
the server, to the client sitting at their desk?

Jeff

"mg" <mg@discussions.microsoft.com> wrote in message
news:9E**********************************@microsof t.com... You want to run this on the Server?


Yes. But for now I'd be happy to get it running on my desktop using Visual
Studio .NET
> Do you get an error?


Yes:
Unhandled exception at 0x65697265 in AcroRd32.exe: 0xC0000005: Access
violation reading location 0x65697265.
Define "have not been able"


The file x.pdf is not printed.
"Jeff Dillon" wrote:
You want to run this on the Server? Do you get an error? Define "have not been able"

Jeff
"mg" <mg@discussions.microsoft.com> wrote in message
news:58**********************************@microsof t.com...
> The following .exe and its parameters work correctly from the command
prompt
> (it prints x.pdf without prompting the user.
>
> acrord32.exe /t "c:\exportfiles\x.pdf" "HP LaserJet 3300 Series PCL 6" "HP > LaserJet 3300 Series PCL" "DOT4_001"
>
> But, I have not been able to use the exe and its parameters as arguments #1
> & #2 in System.Diagnostics.Process.Start( arg1 , arg2) when run in the code
> behind of a Visual Studio WebForm
>
> I have given ASP.NET all permissions, so commands like
>
System.Diagnostics.Process.Start("c:\\windows\\sys tem32\\notepad.exe","c:\\x ..txt"); work fine
>
>


Nov 18 '05 #5
No, not any printer you choose. It must be defined within the context of the
user account running it, AND on the machine it's running from! It would
have to be listed under Printers in Control Panel on the server the ASP.NET
page is being served up from.

You can have the ASP.NET process run under any account you choose. I have
one test site running here under my admin account. As long as I specify a
pre-configured printer in your parameter list, it will print (on/from the
server, not at the client)

Jeff

"mg" <mg@discussions.microsoft.com> wrote in message
news:9E**********************************@microsof t.com...
Show the exact code that you are using, and I'll try it here.
System.Diagnostics.Process.Start("c:\\program files\\adobe\\acrobat
6.0\\reader\\acrord32.exe",@"/t c:\exportfiles\d.pdf 'HP LaserJet 3300 Series PCL 6' 'HP LaserJet 3300 Series PCL' 'DOT4_001'");
How does the paper then get from the printer near the server, to the client sitting at their desk?

It doesn't. This code prints the pdf file on a printer named HP LaserJet
3300 Series PCL 6 (or any other printer name I choose)

=======================

Unless you know how to give the ASP.NET worker process the permissions
(that's a whole nother story), this code won't actually print. But, if this code were to run without error at your site, chances are it would also print here, where the ASP.NET worker process has the permissions it needs to do so.
It appears

"Jeff Dillon" wrote:
Show the exact code that you are using, and I'll try it here.

Just so you know, clients will be printing on the server via this technique, not from their desktop. How does the paper then get from the printer near the server, to the client sitting at their desk?

Jeff

"mg" <mg@discussions.microsoft.com> wrote in message
news:9E**********************************@microsof t.com...
> You want to run this on the Server?

Yes. But for now I'd be happy to get it running on my desktop using
Visual Studio .NET

>> Do you get an error?

Yes:
Unhandled exception at 0x65697265 in AcroRd32.exe: 0xC0000005: Access
violation reading location 0x65697265.

> Define "have not been able"

The file x.pdf is not printed.
"Jeff Dillon" wrote:

> You want to run this on the Server? Do you get an error? Define "have not
> been able"
>
> Jeff
> "mg" <mg@discussions.microsoft.com> wrote in message
> news:58**********************************@microsof t.com...
> > The following .exe and its parameters work correctly from the
command > prompt
> > (it prints x.pdf without prompting the user.
> >
> > acrord32.exe /t "c:\exportfiles\x.pdf" "HP LaserJet 3300 Series PCL 6" "HP
> > LaserJet 3300 Series PCL" "DOT4_001"
> >
> > But, I have not been able to use the exe and its parameters as

arguments
> #1
> > & #2 in System.Diagnostics.Process.Start( arg1 , arg2) when run
in the
> code
> > behind of a Visual Studio WebForm
> >
> > I have given ASP.NET all permissions, so commands like
> >
>

System.Diagnostics.Process.Start("c:\\windows\\sys tem32\\notepad.exe","c:\\x > ..txt"); work fine
> >
> >
>
>
>


Nov 18 '05 #6
I have the problem to to start an application from within a web
application too.
The application is started (I can see it in task manager) but the
window is hidden. I think the ASPNET user has not the permission to
"interact with the desktop". The only way I could start an application
on the server is to change the username attribut in <processmodel> in
machine.config to "SYSTEM".
You wrote, that you gave asp.net all permissions to start e.g.
notepad. Can you please tell me, how you did that?

Thanks, Uli
"mg" <mg@discussions.microsoft.com> wrote in message news:<58**********************************@microso ft.com>...
The following .exe and its parameters work correctly from the command prompt
(it prints x.pdf without prompting the user.

acrord32.exe /t "c:\exportfiles\x.pdf" "HP LaserJet 3300 Series PCL 6" "HP
LaserJet 3300 Series PCL" "DOT4_001"

But, I have not been able to use the exe and its parameters as arguments #1
& #2 in System.Diagnostics.Process.Start( arg1 , arg2) when run in the code
behind of a Visual Studio WebForm

I have given ASP.NET all permissions, so commands like
System.Diagnostics.Process.Start("c:\\windows\\sys tem32\\notepad.exe","c:\\x.txt"); work fine

Nov 18 '05 #7

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

Similar topics

15
1961
by: songie D | last post by:
H If I us Process.Start("DTSRun ...") on a computer that has SQL server installed, it can't fin DTSRun, claiming 'file not found'. Despite this, Shell("DTSRun...") from VB.NET works fine It also...
5
7757
by: mg | last post by:
The following .exe and its parameters work correctly from the command prompt (it prints x.pdf without prompting the user. acrord32.exe /t "c:\exportfiles\x.pdf" "HP LaserJet 3300 Series PCL 6"...
3
3062
by: Wardeaux | last post by:
All, I've written a "setup" wrapper that calls a sequence of "setup.exe", and all works except when I call the setup.exe for the MSDE, then it gets about half way through and then hangs... The...
0
1887
by: LilBuh | last post by:
Hello :) this is a repost... i ve been looking for a way since last week ... i have a template html file that i modify from my code... i need to print this file without IE's Header and Footer or...
2
1754
by: PAPutzback | last post by:
I am trying to decrpyt a gpg encrypted file but the process prompts for a password. The Process.start function is run in a service so I want to be able to pass the password without any user...
0
7186
by: Paul | last post by:
Hi, I'm trying to kick off the iiscnfg.vbs from a webservice to export a website's config to an xml file (And eventually populate other servers with the config). I initially tried this using the...
0
6639
by: Kirk | last post by:
The following C# web service works fine until you uncomment the lines setting UserName and Password. Then, Process.Start throws an Access is Denied Exception. This is with .NET 2.0, of course...
7
13044
by: Ed Bitzer | last post by:
When I use System.Diagnostics.Process.Start("D:\MyDialer.exe 123 456 1234") attmpting to run a dialer from my program, I get an error 5 "The system cannot fine the file specified" If I eliminate...
2
12157
by: Kerem Gümrükcü | last post by:
Hi, i have a Process.Start call that fails with 267 Error Code if invoked with another user and password other than the applications user. It is a ordinary piece of code just create a Process...
0
7109
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
7313
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,...
0
7372
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
7029
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
7481
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
5039
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
1537
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
758
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
411
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.