无法从 pdf 复制确切的印地语内容 [英] Unable to copy exact hindi content from pdf

查看:27
本文介绍了无法从 pdf 复制确切的印地语内容的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我无法从 pdf 文件中复制印地语内容.当我尝试复制/粘贴该内容时,它会更改为不同的印地文字符.

示例-

原文-निर्वाचक

粘贴后-ननरररचक

它是这样显示的.

任何人都可以帮助我获得确切的印地文字符.

解决方案

这个问题与这个答案中讨论的问题类似

a>,而且示例文档的出现也让人想起此处的文档:

简而言之

您的文档本身提供的信息例如标题行中的字形निर्वाचक"代表文本ननरररचक".您应该向文档来源询问字体信息不会误导的文档版本.如果这不可能,您应该使用 OCR.

详细

第一页的顶行由页面内容流中的以下操作生成:

/9 239 Tf(!"#$%&) Tj

第一行选择大小为 239 的名为 9 的字体(页面开头的操作将所有内容缩小).第二行导致打印字形.使用该字体的自定义编码在括号之间引用这些字形.

PDF 第一页上的字体 9 包含一个 ToUnicode 映射.这张图特别贴图

<20><20><0928><21><21><0928><22><22><0930><23><23><0930><24><24><0930>

即代码 0x20 (' ') 和 0x21 ('!') 都映射到 Unicode 代码点 0x0928 ('न') 和代码 0x22 ('"')、0x23 ('#') 和 0x24 ('$')) 全部到 Unicode 代码点 0x0930 ('र').

这样,( !"#$%&)的内容,显示为निर्वाचक",完全正确(根据文档中的信息)被提取/复制粘贴为"ननरररचक".

I am not able to copy hindi content from pdf file. When I am trying to copy/paste that content it changes to different hindi characters.

Example-

Original- निर्वाचक

After paste- ननरररचक

it shows like this.

Anybody can help me to get the exact hindi characters.

解决方案

This issue is similar to the one discussed in this answer, and the appearance of the sample document there does also remind of the document here:

In a nutshell

Your document itself provides the information that e.g. the glyphs "निर्वाचक" in the head line represent the text "ननरररचक". You should ask the source of your document for a document version in which the font informations are not misleading. If that is not possible, you should go for OCR.

In detail

The top line of the first page is generated by the following operations in the page content stream:

/9 239 Tf
( !"#$%&) Tj 

The first line selects the font named 9 at a size of 239 (an operation at the beginning of the page scales everything down). The second line causes glyphs to be printed. These glyphs are referenced inbetween the brackets using the custom encoding of that font.

The font 9 on the first page of your PDF contains a ToUnicode map. This map especially maps

<20> <20> <0928>
<21> <21> <0928>
<22> <22> <0930>
<23> <23> <0930>
<24> <24> <0930> 

i.e. the codes 0x20 (' ') and 0x21 ('!') both map to the Unicode code point 0x0928 ('न') and the codes 0x22 ('"'), 0x23 ('#'), and 0x24 ('$') all to the Unicode code point 0x0930 ('र').

Thus, the contents of ( !"#$%&), displayed as "निर्वाचक", completely correctly (according to the information in the document) are extracted / copy&pasted as "ननरररचक".

这篇关于无法从 pdf 复制确切的印地语内容的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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