I'm trying to find and replace certain text with specific value in PDF. I am using python library pdfrw, since my preferred environment is python. Following is example content in first page of the document.
BT\n/F8 40 Tf\n1 0 0 -1 569 376 Tm\n<0034> Tj\n26 0 Td <0028> Tj\n22 0 Td <0032> Tj\n25 0 Td <0031> Tj\n32 0 Td <0034> Tj\n26 0 Td <0036> Tj\nET\n0 .8863 1 RG
which corresponds to word "REPORT" in the document. So far I've understood meaning of all the special tags and numbers in this format and successfully manipulated position and some characters in it. But I do not understand in what format or encoding each chars are encoded (<0034>, <0028> etc).
I tried brute forcing every single combination of <00xx> but only found valid match for letters R,E,P,O,T, which are letters used in the word. I tried same for F11 and F10 which are included in page and found same result where I matched letters that are only used. If anyone can explain how this encoding works and how can I edit it such that I will be able to insert any utf-8 character, that would be very helpful.
Thank you.
note-1: following is F8 object:
{'/Subtype': '/Type0', '/Type': '/Font', '/BaseFont': '/OpenSans-Bold', '/Encoding': '/Identity-H', '/DescendantFonts': [{'/DW': '0', '/Subtype': '/CIDFontType2', '/CIDSystemInfo': {'/Supplement': '0', '/Registry': '(Adobe)', '/Ordering': '(Identity)'}, '/Type': '/Font', '/FontDescriptor': {'/Descent': '-292.96875', '/CapHeight': '713.86719', '/StemV': '83.984375', '/Type': '/FontDescriptor', '/FontFile2': {'/Length1': '5540', '/Length': '5540'}, '/Flags': '4', '/FontName': '/OpenSans-Bold', '/ItalicAngle': '0', '/FontBBox': ['-619.14063', '-292.96875', '1318.84766', '1068.84766'], '/Ascent': '1068.84766'}, '/BaseFont': '/OpenSans-Bold', '/W': ['0', ['600.09766'], '40', ['560.05859'], '49', ['795.89844', '627.92969', '0', '660.15625', '0', '579.10156']], '/CIDToGIDMap': '/Identity'}], '/ToUnicode': {'/Length': '413'}}
note2: Also replacing text in (nice text)Tj\n or (<0032><0032>) fashion does not works here.