Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Print HTML Page from .net application

Thread Tools

Print HTML Page from .net application

Posts: n/a
We have a requirement in our project to print Html page from a 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

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.

Reply With Quote
Mark Rae [MVP]
Posts: n/a
"Kumar.A.P.P" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...

> 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

Reply With Quote

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
print a vs print '%s' % a vs print '%f' a David Cournapeau Python 0 12-30-2008 03:19 AM
Embedding an html application into a static html page HTML 5 01-09-2008 04:49 PM
Problem - I want to print Current Output of Pdf file and should print once.I get print dialog box but it is not working keto Java 0 05-30-2007 11:27 AM
Print HTML Report Page or Print multiple application pages Sam ASP .Net 1 11-10-2006 10:05 PM
Unlarging the print to print using PDF file to print Bun Mui Computer Support 3 09-13-2004 03:15 AM