怎么用这个itextsharp 呀?ExcelWord文档txt

解决方案 »

  1.   


    是一个dll        /// <summary>
            /// 返回PDF的页数(调用itextsharp.dll)
            /// </summary>
            /// <param name="inputfilepath">指定的PDF文件</param>
            /// <param name="fileCount">返回的页数</param>
            /// <returns></returns>
            public static bool PDFGetPageCount(string inputfilepath, ref int fileCount)
            {            PdfReader pdfReader = null;                         //iTextSharp.text.pdf 命名空间
                try
                {
                    pdfReader = new PdfReader(inputfilepath);       //装载PDF文件
                    int numberOfPages = pdfReader.NumberOfPages;    //返回页数
                    fileCount = numberOfPages;
                     
                    return true;
                }
                catch (Exception ex)
                {
                    ErrLogBll.AddLog(Constants.LogType_Err, Constants.FName_PDFParser, "1", ex.Message, "iTextSharp获取PDF页码异常:" + inputfilepath + ":" + ex.Message);
                    return false;
                }
                finally
                { 
                    if (pdfReader != null)
                        pdfReader.Close();                          //释放资源
                }
            }
      

  2.   


    现在不研究这个了,使用这个需要在电脑上安装office,所以换了一个组件,这个组件GemBox.Spreadsheet,该怎么使用呢?你知道吗?