I am working on a HTML and javascript project. I want to print my document using javascript.
I am using window.print() to print. But how can i pass printing range also? eg: If a document contains 20 pages and i want to print pages from 5-10 only.
I am working on a HTML and javascript project. I want to print my
Share
You cannot set a range using
window.print(), usingwindow.print()invokes your print preferences window which is native print window, where you can set the page range manually..Perhaps you can dynamically set a class for the content you don’t want to get printed, using print specific stylesheet or media queries.