INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Jobs

Window.Print shows URL from link on page

Window.Print shows URL from link on page

(OP)
How do you get window.print() to not print the url of an anchor tag?

I have the following in my page:

<a href="../Views/Home.aspx" style="text-decoration : none; color : #000000;">
<img src="../Images/logo.png" alt="logo" id="logo">
My Company
</a>

This just shows the logo and "My Company" on my screen but on my printer it shows the logo, "My Company" and "(../Views/Home.aspx)".

How do I get the printed version to not show the url?

Thanks,

Tom

RE: Window.Print shows URL from link on page

Printers do not 'know' how to handle a "linked" image so they do the best they can.

Chris.

Indifference will be the downfall of mankind, but who cares?
Time flies like an arrow, however, fruit flies like a banana.
Webmaster Forum

RE: Window.Print shows URL from link on page

Which OS and browser are you using to print?
Chrome has the option to turn on/off header and footer
IE offers to customize the header and footer in page setup.

Bye, Olaf.

RE: Window.Print shows URL from link on page

Quote (Olaf)

Which OS and browser are you using to print?
I get the impression it is the other visitors to the 'page' that the OP wants to control printing for.

Chris.

Indifference will be the downfall of mankind, but who cares?
Time flies like an arrow, however, fruit flies like a banana.
Webmaster Forum

RE: Window.Print shows URL from link on page

I have the same impression, but knowing where this is influenced you can easier deduct this is nothing you can control in your HTML. It's a per Browser and/or OS behavior and the user/visitor can influence that. I wonder whether CSS can influence what header/footer a printed page has, it only influences the HTML page look itself.

If you want control of the printed HTML page, I'd use some service generating PDFs from a page and offer that as download for printing, eg http://pdfcrowd.com/

Bye, Olaf.

RE: Window.Print shows URL from link on page

(OP)
I am not trying to turn off any headers or footers. I can do that fine.

I don't want to turn off the header. The anchor has our logo in it, as you can see from my first post and we want to print that (the image) - so I can't hide the anchor.

My problem is that in a browser the link address is not shown - just the text. If you print the page directly (print button from browser) it prints correctly - without the link's url. But if you try to use windows.print() - it prints the url and that is what I am trying to prevent.

In this case, I am using IE 10.

Thanks,

Tom

RE: Window.Print shows URL from link on page

I don't think this is a bug or feature of IE. CSS might cause this printing behavior, eg a[href]:after { content: " (" attr(href) ")"; }

Bye, Olaf.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Resources

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close