Chrome printing website, missing layout options

CssHtmlGoogle ChromePrinting

Css Problem Overview


I've been creating a website and a portion of the site is designed to be printed on tabloid paper in portrait mode. The problem I'm having is when the print dialog comes up in Chrome it's missing the "Layout" options.

In this screen shot, the left side shows how my dialog box looks vs. how it looks when I print other websites. The ironic thing is even other sites I've created have the option as shown on the right, which is the desired behavior.

print dialog example

My question is, what controls this behavior? How do I correct it? In searching the web the only mention I've see of this is when Chrome is displaying PDF files, but I'm displaying a web page.

Any insight you can give would be greatly appreciated.

Thanks in advance

Css Solutions


Solution 1 - Css

If you have an @page size declaration in the print CSS, this will override (and hide) the orientation on the print dialog. To override a declaration that is set elsewhere (e.g. Bootstrap 4 does this) you can add:

@page {
  size: auto;
}

Solution 2 - Css

Just a quick addition to the accepted answer..

For those who are unable to edit the css of the page you're trying to print, you can install the Chrome extension called 'Stylus' (link here), and create a new style with just the above suggestion:

​​​@page {
  size: auto;
}

This will enable the missing options from the print dialog on any/every web page..

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionThrowBackDewdView Question on Stackoverflow
Solution 1 - CssomnichadView Answer on Stackoverflow
Solution 2 - CssPeterView Answer on Stackoverflow