File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes HTML, CSS and JavaScript and the fly likes Printing functionality using javascript Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Printing functionality using javascript" Watch "Printing functionality using javascript" New topic

Printing functionality using javascript

lokesh pushpa

Joined: Nov 21, 2011
Posts: 23
I have an requirement on printing functionality:

I have a webpage, there i am keeping one print button and using window.print(), i am able to print.
But here i am not getting exact size fitted into the potrait page. Some alignment issues are coming while printing the

1. How to capture the window features
2. How to adjust the margins using javascript
3. How to fit into a single page.

If any grammer mistakes are there please excuse me.
Eric Pascarello

Joined: Nov 08, 2001
Posts: 15385
JavaScript can not control the print settings.
CSS3 has some print settings, but hardly any browser supports them.
I agree. Here's the link:
subject: Printing functionality using javascript
It's not a secret anymore!