Hi,

I just wonder if this is possible. When i print a page from my localhost or web, the html link information is printed at the end of the page. How can disable it?

Thanks

Dani AI

Generated

There are two different things people mean by "the link printed at the end": (a) the page's own anchor text or link list being printed as part of the content, and (b) the browser/driver automatically adding a header or footer with the page URL, date and page numbers. offered a print stylesheet approach and pointed to browser settings; the important point is that headers/footers inserted by the browser or printer are a user/UA-level feature and cannot be reliably suppressed from inside page markup alone.

Practical options that work reliably today:

  • Ask users to disable "headers and footers" (or equivalent) in their browser print dialog when printing a page. This is the simplest end-user fix.
  • For dependable, controlled output across users, produce a printable PDF (server-side or via headless browsers) or a dedicated print view. Tools like headless Chrome/Puppeteer or wkhtmltopdf generate PDF output that does not include the browser UI headers unless explicitly added.
  • For advanced multi-page layout control, use CSS Paged Media features and a renderer that supports them (see W3C CSS Paged Media); commercial renderers (Prince, Antenna House) implement running headers/footers under page control rather than the UA adding them.
    Also check the physical printer/driver settings — some printers stamp job info regardless of browser settings.

Further reading: MDN on print styles and the @page rule (, @page) and the W3C spec for CSS Paged Media (CSS Page Module).

Recommended Answers

All 4 Replies

You'll need to add some style rule in your page:

<html>
<head>
<title>Test Page</title>
<style type="text/css">
<!--

@media print { 
/* Applies to all the links in the page */
a { display : none; }

/* or if you just need to disable specific link */
a#someLinkId { display : none; }
} 

@media screen { 
a { display : inline; }
}

-->
</style>
</head>
<body>
<a id="someLinkId" href="somepage.html">Link with specified ID</a>
<br>
<a href="somepage.html">Link without ID</a>
</body>
</html>

I think should be a bit more specific.

I mean, When i select "Print" from "File" menu from IE or Firefox, the printed paper has the link of the current printed page at the bottom of the A4 paper. I don't want it to be printed on paper.

Thanks

This is a computer specific issue. To remove the tag in IE go to File - Page setup, the footer field should show something like: &u&b&d. Delete this and close window. Try printing and the footer with the pagelink should not be there.

solved thanks

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.