Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Whenever I print a webpage from my browser, the page's URL gets printed at the bottom of the page.

There is no option for this in the printer. There is no option for this in the browser.

Is there a way to prevent the URL from printing ?

share|improve this question

migrated from stackoverflow.com Apr 20 '11 at 10:26

This question came from our site for professional and enthusiast programmers.

    
Which browser/OS? –  Mikecito Apr 19 '11 at 5:29
    
Which browser are you using? IE does have various options in Page Setup to set headers and footers. –  hdhondt May 13 '11 at 1:37
add comment

3 Answers

It depends on your web browser, but in the print dialog there is usually an advanced setup or something. If it's not there, look for a page setup. You just need to turn off the headers/footers.

share|improve this answer
    
can we do that from code.. i am using php and javascript –  Abhilash Apr 19 '11 at 5:30
    
stackoverflow.com/questions/1960939/… –  Mikecito Apr 19 '11 at 5:33
    
There might be something in there that you can use. –  Mikecito Apr 19 '11 at 5:34
add comment

Depends on the browser.

For example, if you go to the about:config page in Firefox, you'll see entries for print.printheaderleft, print.printfootercenter and so on.

These can be set individually.

To do this with Javascript, I think you'd need to code up an extension, since the alternative would be a whopping great security hole large enough to fly a 747 aircraft through.

share|improve this answer
add comment

You can not use JavaScript to set these headers or footers.

However, you can change the settings in your own browser.

Alternatively, you could link to a PDF which prints as is by default.

share|improve this answer
1  
This is how we solve it in my workplace. Anything printable comes back as a PDF for many reasons. –  Mikecito Apr 19 '11 at 5:44
    
I'm not sure if printing to PDF would create different results? Most browsers would not be aware that it's not a real printer and send the very same thing? (However, some browsers —such as Safari and OmniWeb on a Mac— generate clickable inline links when printing to PDF. Hence, these browsers somehow give the printing subsystem more information than the text alone.) –  Arjan Apr 20 '11 at 10:32
    
Sorry, misread your "link to PDF" as "print to PDF". That won't work for just any page a web site visitor sees, but indeed is a good idea for web site builders/editors. –  Arjan Apr 20 '11 at 11:32
add comment

Your Answer

 
discard

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