473,408 Members | 2,888 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,408 software developers and data experts.

Its Urgent,Please Reply

Hi Friends !
Can anyone help? Its an urgent.
I wanted to print PDF Document or Scanned Document Through
my .aspx page .By just clicking a button.I'm not using
codebehind.I want to do printing at my network printer.

I'm using System.Diagnosics.Process Namespace for calling
the print process at the server where i want to do my
printing.I'm only able to run Command.exe and notepad
process. Please help.

My code :

Public Sub PrintDoc(sender as Object, ev As EventArgs)
dim ERROR_FILE_NOT_FOUND As Integer = 2
dim ERROR_ACCESS_DENIED As Integer = 5
Dim myProcess As New Process()

Try
myProcess.StartInfo.FileName =
FileName response.Write
(myProcess.StartInfo.FileName)

myProcess.StartInfo.Verb = "Print"

myProcess.StartInfo.UseShellExecute=true
myProcess.StartInfo.CreateNoWindow = True
myProcess.Start()

Catch e As Win32Exception
response.Write("error")
If e.NativeErrorCode = ERROR_FILE_NOT_FOUND
Then
Response.Write(((e.Message + ". Check the
path.")))

Else
If e.NativeErrorCode = ERROR_ACCESS_DENIED
Then
' Note that if your word processor might
generate exceptions
' such as this, which are handled first.
Response.Write(((e.Message + ". You do
not have permission to print this file.")))
End If
End If
End Try
myProcess.WaitForExit()
if Not myProcess.HasExited Then
myProcess.Kill()
End If
myProcess.Close()

End Sub

--
Amrendra
EName:am******@dosplindia.com
Ph. :91-124-5048883-5
Fax:91-124-5048887
Nov 17 '05 #1
0 1126

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

Similar topics

0
by: felix_william | last post by:
Attention=3A Dear friend=2C REQUEST FOR BUSINESS RELATIONSHIP OF GREAT PROFITS I am HON=2E =28DR=2E=29 Felix William=2C the Director of Procurement and Contract Award at the Nigerian National...
0
by: mohemed _altdou | last post by:
Mr mohemed altdou The Manager of Audit & Accountancy Dept. African Development Bank/ADB. Ouagadougou, Burkina-Faso. ( READ CAREFULLY AND KEEP SECRET) Greeting, and how are you doing?I hope...
2
by: Bill Yin | last post by:
Please tell me where can download <Beginning C# web Applications with Visual studio .net> 's code Thanks in advance!
19
by: Major | last post by:
please help me i want to connect sql serevr with visual basic form but i can't note: (i'm biggner in both of them ) please reply me quickly but please step by step
33
by: dembla | last post by:
Hey Frnds can anyone help me in this i need a program in 'c' PROGRAM to print NxN Matrix 9 1 8 1 2 3 2 7 3 as 4 5 6 6 4 5 7 8 9 in sorted form
1
by: razaqtelecom | last post by:
Hi, I want to know how can i write a stored procedure for the following sceario. Take if there are three tables, table1, table2, table3 and table1 is linked with table2 and table 2 is linked...
1
by: alok sengar | last post by:
hi, I have already tried this URL's code "http://www.java2s.com/Code/CSharp/Network/SimpleSNMP.htm" but I am getting error when i am creating a UDP type Socket and recieving packet from this...
17
by: Saps | last post by:
Hi all. Can anyone help me here. I have loads of .sql files and i need a way to call these from my asp page so the user can run them from the browser. Meaning i have a page with a list of all...
4
by: Adrian Parker | last post by:
We've suddenly started getting a problem with a call to clear the contents of a DataTable. This is on a live customer site that's been working fine until yesterday. As far as we know they've not...
6
by: thijo | last post by:
public class Point { private int x; private int y; private int Number;
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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
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
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
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...
0
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...

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.