Results 1 to 4 of 4

Thread: How to print html page with the print dialogue

  1. #1
    Join Date
    Apr 2009
    Posts
    90

    How to print html page with the print dialogue

    When I surf, for creating a stand alone web page for a kiosk and want to print out coupons. sometimes I see a small "printer" icon with word "print" beside it, usually it is placed at the bottom of the page. If I clicked it, a "Print" dialog box will open. Is there a way to disable this box or tell the page which printer to print to?

  2. #2
    Join Date
    Mar 2008
    Posts
    232

    Re: How to print html page with the print dialogue

    The JTextComponent class provides support for printing text documents. The JTextComponent API includes methods that allow you to implement both basic and advanced printing tasks. When a MIME/HTML message is printed from within the document, and the User Preferences browser option is set to use the default operating system browser, the Windows print dialog box will be displayed.

  3. #3
    Join Date
    Jan 2006
    Posts
    211

    Re: How to print html page with the print dialogue

    JavaScript has no idea of what printer it would need to send the output to since it has no access to see what printers are installed on the computer.I've yet to see a way to do it, but then again I wouldn't do it in the first place. What if your user wants to use a printer other than his/her default?

    using HtmlPrinter;
    hpObj=new HtmlPrinter.HtmlPrinter();
    hpObj.PrintUrlFromMemory(txtUrl.Text);
    This has to already be implemented in your javascript. This is why it's giving you that page with the html. Find the print() function and delete it from your javascript.

  4. #4
    Join Date
    Apr 2008
    Posts
    193

    Re: How to print html page with the print dialogue

    If you print from an open document, the HTML content is retrieved through the browser. The Windows print dialog box is displayed. If the default implementation of the Printable object does not meet your needs, you can customize the printing layout by overriding the getPrintable method to wrap the default Printable or even replace it altogether. If you know php, then you could make it so that the form data is 'sent' and displayed on a new page.

Similar Threads

  1. Adobe Reader 10 print dialogue box is not usable
    By MacKenzie in forum Windows Software
    Replies: 5
    Last Post: 27-06-2013, 06:56 PM
  2. Replies: 5
    Last Post: 14-05-2011, 11:03 PM
  3. Replies: 3
    Last Post: 28-07-2010, 10:19 PM
  4. Replies: 3
    Last Post: 05-12-2009, 01:02 PM
  5. Print spooler hangs when trying to print from a shared print
    By Jisbomb in forum Windows XP Support
    Replies: 3
    Last Post: 27-07-2007, 10:17 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,713,996,687.16874 seconds with 17 queries