MatthewHerbst / react-to-print

Print React components in the browser. Supports Chrome, Safari, Firefox and EDGE
MIT License
2.14k stars 221 forks source link

Disable option in browser window to automatically add headers and footers #715

Closed Dvik closed 1 month ago

Dvik commented 3 months ago

Is there a way i can pass a prop to make sure the browser print window doesn't check the option "Headers and Footers" by default?

MatthewHerbst commented 3 months ago

Unfortunately this is not controllable from JS to my knowledge. The window.print API doesn't take any options, so any control we have is generally limited to what can be done with CSS. We do add some CSS in that generally removes these by setting the margin, so if you're passing your own CSS you should be able to replicate that.