Get PDF page size with iTextSharp

你离开我真会死。 提交于 2019-12-12 10:59:50

问题


I have a PDF document that I just received via file upload (InputFile).

I'd like to use iTextSharp to check it's page size before proceeding. For example, the size of a pdf when you go to file > Properties > Description Tab > Page Size (in acrobat).

Any advice on how I can do that?

THANKS!


回答1:


You need to read the pdf from your input stream (m).

PdfReader reader = new PdfReader(m);
// Page size
Rectangle pagesize = reader.GetPageSize(1);


来源:https://stackoverflow.com/questions/3480730/get-pdf-page-size-with-itextsharp

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!