简体   繁体   English

Objective-c,PDF,如何解决PDF Seaching中的“无法解析嵌入式CMap。”问题?

[英]objective-c, PDF, How to solve “failed to parse embedded CMap.” issue in PDF Seaching?

I am trying perform searching text in PDF, My project works fine on mostly PDF, but it fails to search text on some PDF, and xcode shows this message on console : "failed to parse embedded CMap." 我试图在PDF中搜索文本,我的项目在大多数PDF上都可以正常工作,但是在某些PDF上无法搜索文本,并且xcode在控制台上显示此消息: “无法解析嵌入式CMap。” How to solve this issue, So that I can search text on all PDF. 如何解决此问题,以便我可以在所有PDF上搜索文本。 Any suggestion will be great. 任何建议都会很棒。 Thanks in advance . 提前致谢 。

In general, it is impossible to search for text in all PDFs. 通常,不可能在所有PDF中搜索文本。 This is for two main reasons: 这主要有两个原因:

  1. PDFs use character codes that do not correspond to Unicode. PDF使用与Unicode不对应的字符代码。 A Cmap is used in this case to associate PDF character codes with a Unicode, but is not required to be present in the PDF document. 在这种情况下,使用Cmap将PDF字符代码与Unicode相关联,但不需要在PDF文档中出现。

  2. Even if a Cmap is included, the characters of text are not guaranteed to appear in order in the PDF document. 即使包含Cmap,也不能保证文本字符在PDF文档中按顺序出现。 PDF displays the glyphs corresponding to a character code based on geometry not on text. PDF根据几何而不是文本显示与字符代码相对应的字形。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM