c#如何使用iTextSharp读取/转换/提取希伯来语pdf内容为文本

时间:2016-06-18 11:54:03

标签: c# .net pdf itext

我正在尝试使用iTextSharp

提取希伯来语文本pdf

这是我的代码:

 public string ReadPdfFile(string fileName)
    {
        StringBuilder text = new StringBuilder();

        if (File.Exists(fileName))
        {
            PdfReader pdfReader = new PdfReader(fileName);

            for (int page = 1; page <= pdfReader.NumberOfPages; page++)
            {
                ITextExtractionStrategy strategy = new SimpleTextExtractionStrategy();
                string currentText = PdfTextExtractor.GetTextFromPage(pdfReader, page, strategy);

                currentText = Encoding.UTF8.GetString(ASCIIEncoding.Convert(Encoding.Default, Encoding.UTF8, Encoding.Default.GetBytes(currentText)));
                text.Append(currentText);
            }
            pdfReader.Close();
        }
        return text.ToString();
    }

这是我得到的结果: Click Here to see the image

英文文本出来了,但不是希伯来文部分

如何提取希伯来文?

提前致谢

0 个答案:

没有答案
相关问题