使用itext获取高度和宽度?

时间:2014-03-04 08:25:55

标签: vb.net

我已经尝试但无法获得正确的输出。代码放在下面。

Dim Height, Width As Double
Dim reader As iTextSharp.text.pdf.PdfReader = Nothing
Dim doc As New iTextSharp.text.Document()

reader = New iTextSharp.text.pdf.PdfReader(FILENAME)

iTextSharp.text.pdf.PdfWriter.GetInstance(doc, New FileStream(FILENAME,FileMode.Open))

doc.Open()
Height = doc.PageSize.Height
Width = doc.PageSize.Width
Height = Math.Round(Height)
Width = Math.Round(Width)
doc.Close()

0 个答案:

没有答案