How to determine that a div should occupy the entire space of a PDF A4 sheet by CSS?

Asked

Viewed 235 times

1

How to determine that a div should occupy the entire space of a PDF A4 sheet by CSS?

To generate the pdf I use PHP.

for example

<div class="page">
   // conteúdo da div
</div>

I wish whenever I had a div with the page class it would fill the full page. Can anyone tell me how I determine this in CSS?

  • Better define the title!

  • 2

    http://stackoverflow.com/questions/16649943/css-to-set-a4-paper-size

1 answer

1


I was able to solve by css as follows:

    @page {
        size: A4;
        margin: 0;
    }

    .page {
        width: 21cm;
        height: 22cm;
        padding: 2cm;
    }

Browser other questions tagged

You are not signed in. Login or sign up in order to post.