Go Back   TechArena Community > Software > Software Development
Become a Member!
Forgot your username/password?
Tags Active Topics RSS Search Mark Forums Read

Reply
 
Thread Tools Search this Thread
  #1  
Old 27-07-2009
Member
 
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?
Reply With Quote
  #2  
Old 27-07-2009
Member
 
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.
Reply With Quote
  #3  
Old 27-07-2009
Member
 
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?

Quote:
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.
Reply With Quote
  #4  
Old 27-07-2009
Member
 
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.
Reply With Quote
Reply

  TechArena Community > Software > Software Development
Tags: , , ,



Thread Tools Search this Thread
Search this Thread:

Advanced Search


Similar Threads for: "How to print html page with the print dialogue"
Thread Thread Starter Forum Replies Last Post
Adobe Reader 10 print dialogue box is not usable MacKenzie Windows Software 5 27-06-2013 06:56 PM
Microsoft excel is not able to print some document which use to print on one page sObama Windows Software 5 14-05-2011 11:03 PM
Using current XP Print drivers and Windows 7 Print drivers on 2003 Print Server Richcom Operating Systems 3 28-07-2010 10:19 PM
Problem of Print Preview & Print of web page in IE over windows 7 OS Rup_me Operating Systems 3 05-12-2009 01:02 PM
Print spooler hangs when trying to print from a shared print Jisbomb Windows XP Support 3 27-07-2007 10:17 PM


All times are GMT +5.5. The time now is 09:30 PM.