码迷,mamicode.com
首页 > 其他好文 > 详细

使用Itext获取pdf文字的坐标

时间:2017-07-20 10:23:53      阅读:752      评论:0      收藏:0      [点我收藏+]

标签:threading   text   extra   ber   static   logs   task   nbsp   parser   

using iTextSharp.text.pdf;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace TestIText
{
    class Program
    {
        static void Main(string[] args)
        {
           PdfReader readerTemp = new PdfReader(@"D:\_Number position.pdf");

            PdfHelper.LocationTextExtractionStrategyEx pz = new PdfHelper.LocationTextExtractionStrategyEx();

            iTextSharp.text.pdf.parser.PdfReaderContentParser p = new iTextSharp.text.pdf.parser.PdfReaderContentParser(readerTemp);
            p.ProcessContent<PdfHelper.LocationTextExtractionStrategyEx>(1, pz);

            Console.WriteLine(pz.GetResultantText());
            Console.ReadLine();


        }
    }
}

 

使用Itext获取pdf文字的坐标

标签:threading   text   extra   ber   static   logs   task   nbsp   parser   

原文地址:http://www.cnblogs.com/YzpJason/p/7209186.html

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