473,396 Members | 1,780 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,396 software developers and data experts.

Print HTML Page from .net application

We have a requirement in our project to print Html page from a vb.net windows
service application. The application should not display any dialog box. The
Printer details, which varies for different Print Jobs, needs to be
programmatically set. We have found the following code on the net which can be
used to print HTML page.

Dim p As New System.Diagnostics.ProcessStartInfo
p.Verb = "print"
p.WindowStyle = ProcessWindowStyle.Hidden
p.FileName = "C:\tEMP\NewFolder\sparsh.html"
p.UseShellExecute = True
System.Diagnostics.Process.Start(p)

The above code is printing the html file but the problem is that the printer
dialog box is displayed every time the page is printed.
Please suggest a way out where we can eliminate the Dialog Box? Any other
approach to print HTML page from .net application can also be take up.

--
Kumar.A.P.P
http://techaid.wordpress.com/
Nov 19 '07 #1
1 1852
"Kumar.A.P.P" <Ku******@discussions.microsoft.comwrote in message
news:F7**********************************@microsof t.com...
The above code is printing the html file but the problem is that the
printer
dialog box is displayed every time the page is printed.
More to the point, the above code is running on the webserver, not the
client machine - as soon as you try to run this in a server environment, it
will not work at all...

Where is the printer that you're trying to print to? If it's a network
printer, your best solution would be to write a webservice which sniffed a
database for print jobs.

If it's attached to the client machine that the browser is running on, you
cannot do this natively - you'd need at the very least to write an ActiveX
control and then ramp your security right down just to get it to download
and install, never mind run...
--
Mark Rae
ASP.NET MVP
http://www.markrae.net

Nov 19 '07 #2

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

Similar topics

21
by: Steel | last post by:
Hi at all, I have a very long html page with many photo. Therefore the best to print this page is to print the some page as PDF. Therefore I maked a PDF file like my page to print best. I'ld want...
3
by: Andy | last post by:
Hello, I have a web application where one of the admin features is to print a list of foreclosure listings. The client wants to have two cases per page printed. I have figured a way to insert...
3
by: Richard | last post by:
in a previous aspx page i got a few records printed throu window.print() function in javascript. but now i have the records in a to RTF and i want to run the same function print, which ofcourse...
4
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...
8
by: jbonifacejr | last post by:
This is my first day here, so please be patient. I do not know how to search very well so the search I tried to get the answer showed me topics from the year 2000 and they really don't cover what I...
4
by: Vera | last post by:
Hi there! I'm a total newbie at web development, so I started bydownloading and installing Visual Web Developer 2005 Express Edition as well as SQL Server 2005 Express Edition. I also downloaded...
1
by: Sam | last post by:
Hi All I have a web page that contains a datagrid and in this data grid, I have a checkbox column template which allow user to select one or more applicant's loan applicantion to print....
0
by: thirunavukarasukm | last post by:
Hai.... To print Html page using PrintDialog and Print Document i am created one windows appication.. the windows application have many pages in my booking page i have two buttons one...
0
by: Andrew Meador | last post by:
I have implemented a printing scenario where an html file is printed using the the following code: public void PrintHtmlFile(string url) { RegistryKey IERegKey; string header = null; string...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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: 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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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...

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.