如何获取打印区域的大小?

问题描述:

需要以像素为单位计算内容的大小的打印区域。 对于大小我使用的CSS:如何获取打印区域的大小?

@page { 
    size: 11in 8.5in; 
    margin: 1in; 
} 

enter image description here

你的问题有点含糊,但假设你想通过JavaScript要做到这一点,请参阅:

How do I retrieve an HTML element's actual width and height?

Get div height with plain JavaScript

Get DIV width and height in javascript

+0

不,我需要大小的打印区域(打印ctrl + p)来计算内容。 –