itextsharp: what is the height of a regular PDF page in pixels?

后端 未结 3 897
谎友^
谎友^ 2020-12-28 18:24

What is the height of a regular PDF page in pixels?

I heard it was something like this:

Dim pgSize As New iTextSharp.text.Rectangle(595, 792)
         


        
3条回答
  •  小鲜肉
    小鲜肉 (楼主)
    2020-12-28 18:40

    iTextSharp expresses dimensions in terms of points. They use the commonly accepted standard of 72 points per inch. You asked for measurements in terms of pixels, iTextSharp uses 96 pixels per inch, or an approximate conversion of 1.3333 * points = pixels.

    So if your page size is 8.5 inches x 11 inches, in pixels it would be 816 x 1056. In points it would be 612 x 792.

    Note that iTextSharp defaults to a page size of A4 - which is 8.27 inches x 11.69 inches (slightly more elongated that the US Letter standard). This equates to 595 x 841 in points and 794 x 1122 in pixels.

提交回复
热议问题