dcsimg
how to display printer configuratin dialog in web page.
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   zhao_escort
Posted On:   Sunday, June 16, 2002 11:15 PM

hello. JGuru: i am trying to customerize the printing style of a web page, (that is , what really be printed is based on the web page content, but the style will be changed, for example, there are table with many input boxes in the web page, i will print the table without input boxes, instead with row and column lines). the web page is generated by JSP, there is a button in the web page, when user clicks on the button, the printer selection dialog should be displayed to let user choose a printer from all the installed printers to print the page. since java written in JSP runs at Server, so i guess i have to implement it with combination of JavaScript and other technique ( include an invisible applet? included an object? ). right now, i wrote an applet    More>>

hello. JGuru:
i am trying to customerize the printing style of a web page, (that is , what really be printed is based on the web page content, but the style will be changed, for example, there are table with many input boxes in the web page, i will print the table without input boxes, instead with row and column lines). the web page is generated by JSP, there is a button in the web page, when user clicks on the button, the printer selection dialog should be displayed to let user choose a printer from all the installed printers to print the page. since java written in JSP runs at Server, so i guess i have to implement it with combination of JavaScript and other technique ( include an invisible applet? included an object? ). right now, i wrote an applet

public class TestPrinter extends Applet
{
public void setUpPrinter()
{
PrinterJob pjob = PrinterJob.getPrinterJob();
PageFormat pf = pjob.defaultPage();
// pjob.setPrintable(new Printable(), pf);
try {
if (pjob.printDialog()) {
pjob.print();
}
} catch (PrinterException e) {
}


}

}

in the html generated by JSP , include the following code:





in the javascript function SetPrinter()
{
var app = document.applets[0];
alert(app);
app.setUpPrinter();
}

is there any problem, and what's the proper solution?
thanks ahead.    <<Less

Re: how to display printer configuratin dialog in web page.

Posted By:   Akash_Srivastava  
Posted On:   Monday, June 17, 2002 09:58 PM

if u r doing client side printing then u have to just write a finction in java script in which u can write window .print()
About | Sitemap | Contact