如何在C#中提取时从pdf中获取正确的文本? [英] How do I get proper text from pdf while extraction in C#?

查看:303
本文介绍了如何在C#中提取时从pdf中获取正确的文本?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在编写一个从PDF中提取文本的程序。提取工作正常,在将文件保存为XML之前,我必须将几个符号转换为各自的十六进制代码。



问题在于所有符号中的符号当我将■保存到XML文件中时,它会转换为|。



然后我将其保存到所需的手动替换它文件。



请帮忙。



我的尝试:



我只需要一个基本的想法,我该如何摆脱这个。

I am writing a program to extract text from PDF. The extraction is working fine and I have to convert a few symbols to their respective hex codes before saving the file as XML.

The issue is that out of all the symbols, when I am saving "■" into an XML file, it is getting converted to "¦".

I am then manually replacing it before saving it to the desired file.

Please help.

What I have tried:

I just need a basic idea as to how can I get rid of this.

推荐答案

显示的字符将根据您用于显示它们的字符集而有所不同。您的程序需要查看实际的字符代码值,并根据需要进行调整,以匹配您正在使用的集合中的相应代码。请查看Windows附件部分中的字符映射应用程序,以获取所用值的更多详细信息。
Displayed characters will vary according to which character set you use to display them. Your program needs to look at the actual character code value and adjust it as necessary to match the corresponding code in the set you are using. Take a look at the Character Map application in the Windows Accessories section for further details of the values used.


这篇关于如何在C#中提取时从pdf中获取正确的文本?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆