Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can i print html page at 300 dpi resolution

i have a web page that encoded in html and css. the size of the web page is of A4 Page (300dpi) = 2480 X 3508 (PX).

the problem is that when i print my web page it's printing in 72/96dpi resolution and print 7 pages instead of 1, and i want that the printer will print my web page in 300dpi resolution.

some code in CSS, HTML, JAVASCRIPT or something that can help me?

thanks.

like image 608
user3502020 Avatar asked Oct 21 '22 10:10

user3502020


1 Answers

You can use CSS just like:

@media print {
    @page {
        size: 210mm 297mm;
    }
}

or with px:

@media print {
    @page {
        size: 2480px 3508px;
    }
}

https://developer.mozilla.org/en-US/docs/Web/CSS/@media#media_types

like image 128
iugo Avatar answered Oct 31 '22 16:10

iugo