basagabi
basagabi

Reputation: 5064

How to get the HTML source from window.print

I have a printable version of a page using window.print(). How do I get the HTML of it (print version) without opening the printer dialog? This is because I want to get the HTML code of it and pass it as a post request

Upvotes: 0

Views: 264

Answers (1)

Ronald
Ronald

Reputation: 1039

As far as I know it's only the stylesheet that is changed, not the HTML. Browsers come with default styles for displays and for print. You can customize the print view using media queries in your CSS. That is how a lot of sites for example strip color or underlines from links in the print view.

Upvotes: 1

Related Questions