Unable to copy exact hindi content from pdf

允我心安 提交于 2019-11-26 20:50:24
mkl

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 "ननरररचक".

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!