Calculation method
The general resolution is XX pixels per inch, where one inch is 25.4 mm.
So the number of pixels in a millimeter is xx/25.4. Now the job is to ask for the value of XX, the value of XX to find out later,
The pixel width of the A4 paper is obtained directly with xx/25.4 * 210.
The size of A4 paper is 210mmx297mm.
When the resolution is 72 pixels per inch, the pixel of the A4 paper size image is 595x842 (recommended for this size ratio).
When the resolution is 150 pixels per inch, the pixel of the A4 paper size image is 1240x1754.
When the resolution is 300 pixels per inch, the pixel of the A4 paper size image is 2479x3508.
Selecting a different resolution image pixel size also varies.
I use the following conversion formula to convert A4 paper to the resolution in the screen
Page margin: 0.75 inch
a4:8.27x11.69 inch
Printer dpi:600dpi
Screen dpi:96dpi
width = (8.27-0.75 * 2) * 96/600 = 650 px
Height = (11.69-0.75 * 2) * 96/600 = 978 px
So, when the <table> width=650px, height=978px, when using IE printing, just can print a page of A4 paper.
A dpi (Dots Per Inch) indicator must be used when converting metric length units to screen resolution.
The default in the 96dpi,mac system for Web page printing on Windows systems is 72dpi.
A4 paper size is 210x297mm, 1 inch =25.41mm conversion, that is 8.264x11.688 inch
So, the resolution of A4 paper 96dpi is 794x1123, which is the pixel we need when we make the Web page.
Ideally, the resolution of the largest element in the Web page is 0mm when the margin is printed: 794x1123
<div style= "width:794px;height:1123px;border:1px solid #000000;" ></div>
However, the printer is not full-width printing, there will always be margins, so we have to make a page when the page must be taken into account margins.
The print margins of various browsers are set differently, ie prints the default margins of 19.05mm,
Therefore, the resolution of the maximum elements in a page page designed for IE print pages should be: 649x978
<div style= "width:649px;height:978px;border:1px solid #000000;" ></div>
Width,height how many px, A4 paper is printed exactly one page?