码迷,mamicode.com
首页 > Windows程序 > 详细

c#获取pdf文件页数

时间:2018-10-22 13:01:59      阅读:658      评论:0      收藏:0      [点我收藏+]

标签:ber   col   bsp   sha   fread   reader   .text   nbsp   response   

引用命名空间:using iTextSharp.text.pdf;

            string filePath = Server.MapPath("/upload/123.pdf"); //文件的物理路径

            PdfReader reader = new PdfReader(filePath);
            int iPageNum = reader.NumberOfPages; //文件页数
            reader.Close();

            Response.Write("文件页数:" + iPageNum);

 

c#获取pdf文件页数

标签:ber   col   bsp   sha   fread   reader   .text   nbsp   response   

原文地址:https://www.cnblogs.com/zhangwj/p/9829166.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!