How to remove header and footer from print pdf in html?

I am using window.print() for printing page, but I got header and footer contains page title, page url, page number and date. How to remove them from the PDF?

Senior Developer Asked on June 14, 2019 in HTML.
Add Comment
1 Answer(s)

 

I have removed header & footer from print pdf using the below css.

<style type="text/css" media="print">@page

{

size:8.5in 11in;

margin: 0

}
</style>

 

Team Leader Answered on June 17, 2019.
Add Comment

Your Answer

By posting your answer, you agree to the privacy policy and terms of service.