3

Problem

I'm currently using a stylesheet print.css to remove elements and some styling to create a printer-friendly page, but I can't seem to remove four things that appear in the corners of the page, but are not in the HTML: pagination, date printed, title of page, URL of page

Possible solution?

I've seen this example from the LA Times that shows elements that are not in the HTML, but typically appear when printed being removed: http://graphics.latimes.com/oscar-bingo-2015/

Community
  • 1
  • 1
Andrew Nguyen
  • 1,416
  • 4
  • 21
  • 43

2 Answers2

3

There are quite a few posts on the subject here on StackOverflow:

Looks like it works by using the @page media property in combination with the print media property:

@media print {
    @page { margin: 0; }
  }

However, it only seems to work in Chrome (for the moment). Firefox can be made to oblige, though. Elsewhere, it was suggested to create PDF on the fly - or to use JavaScript to set at least the page title to an empty string.

Also, I'd question why you'd want to hide something your users are usually used to have control over.

To answer your question, though: The LA Times use bootstrap, which sets the page margin as follows:

...@page{margin:.5cm}...
Community
  • 1
  • 1
Christian
  • 6,070
  • 11
  • 53
  • 103
  • 1
    `@media print { @page { margin: 0; } body { margin: 1.6cm; } }` – Muhammad Fahad Feb 24 '16 at 07:00
  • 1
    The problem with this method is that you (obviously) end up with all the content right against the edge of the page. Muhammad's addition prevents that from happening, but at the cost of any subsequent pages having no margin between their content and the top of the page. Setting the page margin to .5cm is the best solution I've found so far, but of the browsers I've tested it only works properly in Chrome. – chrBrd Jan 19 '17 at 06:36
0

That's some browser specific printed info. You can't change that, the user has to set its printing properties correctly.

See also: Removing page title and date when printing web page (with CSS?)

EDIT: this happens to be doable, but I have no idea how.

Community
  • 1
  • 1
Domino
  • 6,314
  • 1
  • 32
  • 58
  • I've seen this recently and their printed page doesn't seem to have those things, wondering how they might have done it: http://graphics.latimes.com/oscar-bingo-2015/ – Andrew Nguyen May 04 '15 at 20:43
  • Wow, you're right! I have no idea how they did this. – Domino May 04 '15 at 20:58