Does anyone know the code in any language, to print a HTML page without title and url on top (bottom, depends on browser):?:

Dani AI

Generated

Short answer for : you cannot reliably force every browser to stop printing the browser-added header/footer (page title, URL, date) from a webpage using HTML/CSS/JS. Those headers are controlled by the user's browser print settings for privacy and security, so page code cannot turn them off everywhere.

What you can do inside the page is provide a print stylesheet that hides site chrome and lays out content for paper. Example print rules:

@page { margin: 10mm; }

@media print {
  header, footer, nav, .no-print { display: none !important; }
  body { margin: 0; }
}

That removes your site header/footer from the printed page and controls margins, but it will not remove the browser's own header/footer.

If absolute control is required (no browser header/footer for all users), generate the printable output yourself and deliver a PDF instead of relying on the browser print dialog. Headless Chrome / Puppeteer can render pages to PDF with displayHeaderFooter: false for consistent results (Puppeteer page.pdf options). Server-side renderers such as wkhtmltopdf or commercial paged-media tools (PrinceXML) also produce printer-ready PDFs. Third-party browser plugins or ActiveX approaches (as historically suggested) are platform-specific, fragile, and insecure for public sites, so they are only realistic in locked-down intranet/kiosk environments.

For most public web sites the practical pattern is: supply a print stylesheet for good-looking prints and offer a downloadable PDF when exact print fidelity (and removal of browser headers) is required. For print-css details see .

Recommended Answers

All 3 Replies

Member Avatar for Member #114696

Goto
File->Page Setup and set all the options you want.
For example to hide the link of page on top clear header.

Thx, but i'd rather mean code, which will make every browser on every computer turn off header, of course if its possible, but ithink it should be...

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.