c# - iTextsharp:减少从 pdf 阅读器提取的文本中字符之间的间距
问题描述
我发现从 pdf 阅读器中提取的文本中出现的字符之间的间距更大。我不想使用提取文本中的功能"trim"
。"replace"
建议我如何避免字符之间的间距
我已经尝试过 ITextExtractionStrategy,但它没有用
我不想修剪或替换提取文本中的注释
StringBuilder pdfContent = new StringBuilder();
for (int i = 1; i <= reader.NumberOfPages; i++)
{
ITextExtractionStrategy its = new iTextSharp.text.pdf.parser.SimpleTextExtractionStrategy();
pdfContent.Append(PdfTextExtractor.GetTextFromPage(reader, i, its));
}
reader.Close();
string strPdfContent = Convert.ToString(pdfContent);
=================
提取文本:
检验批号:123456789 材料 0 8 1 6 0 1 1 2 0 0 1 LBLDTUBELIATFLUA / B & RSVIVDB 批号:8 7 6 8 4 ZV 批号批号:过期日期:2 0 2 0 - 0 8 - 3 1 I n 规格类型 : G oods Rceiptfrom Pr oduction
================
预期文本:
Inspection lot: 123456789
Material 07568681001 OBID CAR COBAS LIAT FLU A/B Batch: 87684Z
Vendor Batch: Expiry date: 2020-08-31
Inspection Type: Goods Receipt from Production
解决方案
推荐阅读
- azure - Get Cosmosdb Container Collection items using powershell
- python-3.x - cv2.VideoWriter,带有视频文件的上限
- c# - 如何在 Unity C# 脚本中引用另一个项目
- user-interface - 如何在 Flutter 中圆化此面板的边缘?
- swift - 带有 pinToVisibleBounds 的 UICollectionView 组合布局标头奇怪地被单元格遮挡
- python - 并行进程Stata-Python
- ruby-on-rails - 为每个新实例实例化(刷新)的类变量
- python - 在 matplotlib 中为图形指定轴
- anylogic - 如何从与 Anylogic 仿真窗口相同的外部用户界面运行仿真?
- assembly - 用于 ARM64 的 ARM 未缓存内存的 memcpy