Print HTML Page from .net application

Discussion in 'ASP .Net' started by Kumar.A.P.P, Nov 19, 2007.

  1. Kumar.A.P.P

    Kumar.A.P.P Guest

    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/
     
    Kumar.A.P.P, Nov 19, 2007
    #1
    1. Advertising

  2. "Kumar.A.P.P" <> wrote in message
    news:...

    > 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
     
    Mark Rae [MVP], Nov 19, 2007
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Bernard Segonnes

    Print and print overview and current page

    Bernard Segonnes, Nov 4, 2004, in forum: Java
    Replies:
    0
    Views:
    460
    Bernard Segonnes
    Nov 4, 2004
  2. Sam
    Replies:
    1
    Views:
    678
    seigo
    Nov 10, 2006
  3. Ben
    Replies:
    5
    Views:
    5,326
  4. keto
    Replies:
    0
    Views:
    1,001
  5. David Cournapeau

    print a vs print '%s' % a vs print '%f' a

    David Cournapeau, Dec 30, 2008, in forum: Python
    Replies:
    0
    Views:
    374
    David Cournapeau
    Dec 30, 2008
Loading...

Share This Page