Click here to Skip to main content
15,905,913 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi There,

I am using java script function(document.execCommand('print', false, null)) and we cal this function on print button on page to open the print window for printing the document, but the behavior of printing document is differ browser by browser.When i print document by clicking print button of page into IE 8 it prints only into single page. But when I print same document by clicking print button on page into chrome it prints document into page with last line on second page. Can any one please suggest me what i need to do for this. Reply ASAP.
Posted

Use Print @media CSS for this ..

it will setting to all browsers which you want.
for more info about it, please follow below links.

http://www.w3schools.com/css/css_mediatypes.asp[^]

https://developer.mozilla.org/en-US/docs/Web/CSS/@media[^]

http://www.tutorialspoint.com/css/css_printing.htm[^]

Regards,
AARIF SHAIKH
 
Share this answer
 
you have to change print setting . in chrome like remove header footer . paper size either client browser or print option
 
Share this answer
 
Comments
nira.parmar 10-Sep-15 10:57am    
We don't want to remove header. As it shows into IE 8 same we want it from chorme as well. And user don't want to change any setting every thing will be done from java script or code.
under web development, you can't touch the printer using javascript. You can't even know whether there's a printer attached to the computer viewing your website. And after you issued window.print(), you can't find out whether the page has been printed successfully.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900