Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Prevent printing url while window.print

I am using javascript window.print(); to print web-page. On printout, it is showing url like http:\...

How i could avoid it?

like image 977
MayureshP Avatar asked Nov 30 '25 23:11

MayureshP


1 Answers

You can't control this in javascript, it has to be done at the browser level.

This post explains how to do it in Firefox and IE http://www.howtogeek.com/howto/the-geek-blog/prevent-firefox-or-internet-explorer-from-printing-the-url-on-every-page/

What we have done in the past is just have a link explaining to the user how to do this for their browser.

EDIT

What we've also done is generate a PDF so that you can make the page look the same across all browsers. iTextSharp is a free tool to do this. Just a note, it is kinda unfriendly. There is an example here. Basically, you input HTML and it converts it to a PDF.

like image 63
FarFigNewton Avatar answered Dec 02 '25 13:12

FarFigNewton



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!