on-internet
← Community

How to remove unwanted white space from my print page

Stack Overflow ·

How to remove unwanted white space from my printed output, while printing my div. I have to print content of DIV like POS receipt but it getting extra white space at top and bottom, I just want print only div content. This image with marked unwanted space This is image of current printing receipt function printdiv(printpage) { var headstr = "<html><head><title></title></head><body>"; var footstr = "</body>"; var newstr = document.all.item(printpage).innerHTML; var oldstr = document.body.innerHTML; document.body.innerHTML = headstr+newstr+footstr; window.print(); document.body.innerHTML = oldst

Comments

Sign in or sign up to comment and upvote.

No comments yet.