Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Print size problem #42

Open
tuperhero opened this issue Aug 28, 2020 · 4 comments
Open

Print size problem #42

tuperhero opened this issue Aug 28, 2020 · 4 comments

Comments

@tuperhero
Copy link

Hi. Great snippet. Might be missing something though, when printing a page using the A4 style, it comes out about 2/3 of the size of the page. Tried across multiple browsers and OS. Any ideas ?

@andersou
Copy link

andersou commented Sep 26, 2020

Hi @tuperhero , i did some tests and found the problem. Libraries like bootstrap set min-width in body to 992px (what makes the overflow), try this (defined after bootstrap and styles in head):

<style>
      @page {
        size: A4;
        margin: 0;
      }
      body {
        min-width: initial !important;
      }
</style>

worked for me 😉

@tuperhero
Copy link
Author

@andersou wow that worked like a charm. Thanks so much I spent ages trying to figure it out, didn't even occur to me that Bootstrap could be getting in the way. Cheers !

@mrevening
Copy link

This one helped me

<style>
      @page { size: A4; }
      @media (min-width: 576px) {
        .container, .container-sm {
          max-width: initial;
        } 
      }
</style>

@n8green
Copy link

n8green commented Feb 22, 2022

I'm seeing this issue despite not using any other CSS framework, and nothing I do seems to make any difference. Any pointers on things I should be specifically looking at?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants