itextsharp:常规PDF页面的高度是多少? [英] itextsharp: what is the height of a regular PDF page in pixels?

查看:2147
本文介绍了itextsharp:常规PDF页面的高度是多少?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

普通PDF页面的高度是多少?

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

我听说是这样的:

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

但是我添加的图像占据了一半的高度,即使pgSize看起来像一个整页而且图像只占用了一半,我的图像高度达到了619?

but I am adding an image that takes up maybe half the height, and even though pgSize looks like a full page and the image takes up only half of it, I am getting a height of like 619 for the image?

我不知道它是否在同一个单位?

I do not know if it is in the same units?

推荐答案

您的页面大小取决于您在创建文档时设置的内容,可能使用PageSize对象(例如PageSize.LETTER)。

Your page size depends on what you set it when you create the document, probably using the PageSize object (eg. PageSize.LETTER).

一旦建立那个,iTextSharp中的大多数元素都使用积分,1英寸= 2.54厘米= 72个点。

Once you've established that, most elements in iTextSharp use points and 1 in = 2.54 cm = 72 points.

所以如果你使用标准的字母页面(8.5x11),它将是612 792。

So if you used a standard letter page (8.5x11) it would be 612 by 792.

我不确定我理解你关于图像的第二个问题,但我相信iTextSharp中的所有单位都是积分。

I'm not sure I understand your second question about the image, but I believe that all the units in iTextSharp are points.

这篇关于itextsharp:常规PDF页面的高度是多少?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆