I have to develop a web page that have a button to print the current web page. How can I achieve this through JavaScript? Or Is there any other scripting language or framework to achieve this easily?
UPDATE
I have to pass some data from my server or my browser memory to the printer driver so that I can use these data to print in a formatted way.
Just call window.print()
. That is same as the user pressing eg Ctrl + P
on windows.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.