iTextSharp小白教程+dll下载

本文是一篇关于iTextSharp的简单教程,介绍了如何下载并引用这个库来处理PDF文件。通过添加itextsharp.dll的引用,并导入相关命名空间,可以使用iTextSharp进行PDF的生成和读取操作。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

iTextSharp,其实很多时候都是用于生成PDF,但是他读取PDF的能力也不差,使用如下:
  1、下载iTextSharp
  2、引用动态链接库
  解压缩下载的压缩包里面的itextsharp-dll-core.zip,得到itextsharp.dll,在项目中添加引用itextsharp.dll即可
  在文件中需要引入以下3个命名空间:
  using iTextSharp;
  using iTextSharp.text;
  using iTextSharp.text.pdf;
  3、API的使用方法看代码:
 

 public static void ConvertPdfToWordByText(string pdfFilePath, string wordFilePath)
    {
        
        using (iText.Kernel.Pdf.PdfReader reader = new iText.Kernel.Pdf.PdfReader(pdfFilePath))
        {
            using (iText.Kernel.Pdf.PdfDocument pdfDoc = new iText.Kernel.Pdf.PdfDocument(reader))
            {
                Spire.Doc.Document doc = new Spire.Doc.Document();
                for (int i = 1; i <= pdfDoc.GetNumberOfPages(); i++)
                {
                    iText.Kernel.Pdf.PdfPage page = pdfDoc.GetPage(i);
                    var strategy =
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值