Text insertion based on font encoding #3568
Replies: 4 comments 10 replies
-
I saw that all text on this page is Hindi, written in some Devanagari font. |
Beta Was this translation helpful? Give feedback.
-
insert_text worked fine even in the above case but when C2_0 font reference was used which had Identity-H encoding but when TT0 reference was used it did not work. Can you please let me know how to predict only font name corresponding to a specific encoding should be used? |
Beta Was this translation helpful? Give feedback.
-
Osho_Rajneesh_Sambhog_Se_Samadhi_Ki_Or.pdf |
Beta Was this translation helpful? Give feedback.
-
Thanks for clarifying. Is there any way to know which font reference name to be used in this case(same font names in page.get_fonts())? |
Beta Was this translation helpful? Give feedback.
-
I have tried extracting the spans of the first line of the PDF and reinserting using a different color via page.insert_text().
When I used page.get_fonts() to extract the fonts, I observed that the font name was Arial Unicode MS and the same font was present in the output with different encodings (WinAnsi and Identity-H).
page.insert_text() was able to insert the complete text when font reference name corresponding to Identity-H was used but when font reference name corresponding to WinAnsi encoding was used, the created PDF had weird characters. Could you let me know the reason for this?
hindi.pdf
Beta Was this translation helpful? Give feedback.
All reactions