【发布时间】:2015-09-26 17:05:18
【问题描述】:
我正在使用带有变音符号的希伯来语 pdf。我想提取所有带有坐标的单词。我尝试使用 ITextSharp 和 pdfClown,但它们都没有给我想要的。
在 pdfClown 中,ITextSharp 中缺少字母\字符我没有得到单词坐标。
有办法吗? (我正在寻找一个免费的框架\代码)
编辑:
PDF小丑代码:
File file = new File(PDFFilePath);
TextExtractor te = new TextExtractor();
IDictionary<RectangleF?, IList<ITextString>> strs = te.Extract(file.Document.Pages[0].Contents);
List<string> correctText = new List<string>();
foreach (var key in strs.Keys)
{
foreach (var value in strs[key])
{
string reversedText = new string(value.Text.Reverse().ToArray());
string cleanText = RemoveDiacritics(reversedText);
correctText.Add(cleanText);
}
}
【问题讨论】:
-
由于您没有解释您是如何使用 iTextSharp 或 PDFClown 进行尝试的,因此很难判断您做错了什么。
-
我添加了pdf小丑的代码。至于itextsharp,我没有代码..但如果你知道怎么做,请告诉我。
-
那是相当不幸的,毕竟你似乎已经得到了所有的单词,只是没有得到位置,并且添加这并不难。在pdfclown的上下文中,您能否分享一个示例PDF并指出缺少哪些字母?
-
filedropper.com/test23 987654321 @有多个缺失的字母,例如:מאמָטִיקָהלית-ארהיְּסוֹדִי - 为此线路我得到:מָתֵמָטִיקָטִיקָהבֵבֵבֵבֵפֶפֶרהְַּסֹדִ现在举一个词,例如: הַיְּסוֹדִי 我得到: הַ ְּ סֹדִ י
-
好的,我明天在办公室调查一下。
标签: pdf itextsharp coordinates words pdfclown