Writing multi lingual text in PDF

Viewed 55

My intention is to write a PDF file with multi lingual text using Arial, Nirmala (simple one I chose) font. But after using PDF doc for few months time, am unable to get the right mix of objects usage in writing to PDF after many failed attempts using standards and specifications from Truetype, CIDFontType0 (Truetype), Embedding and non embedding, Encoding Identity-H and without encoding.

I need to print a Greek char and a Indian char. Attached is a sample of my generated output with a Greek Alpha using Arial.

<</Font <</FXF1 8 0 R >>>>endobj

Contents: 7 0 obj..<</Length 107 /Filter /FlateDecode >>stream..x..wI-.LN.rwRH.V0....<.}..s0T<..O.P.)DA.-..P.P!$M..B.......@...............!.+$7Z#b........]lH..k.B...#~"...endstream.endobj

Font: 8 0 obj..<</Type /Font /BaseFont /Arial /Subtype /TrueType /FirstChar 1/LastChar 5/Widths [ 750 666 ]./FontDescriptor 9 0 R >>endobj

FontDescriptor: 9 0 obj..<</Ascent 1060/CapHeight 718/Descent -307/Flags 32/FontBBox [-1171 -328 2506 1166] /FontName /Arial/FontStretch /Normal /FontWeight 400/ItalicAngle 0/StemV 68/XHeight 531/FontFile2 10 0 R /Type /FontDescriptor >>

I embedded the whole font file and am able to use the font file binary in another document to generate its text, so, I guess font file is properly compressed. Other values I used my default usage and local samples using such values.

I need to know , how to embed only a portion of the font file in pdf. I also need to know, how the text input to be given, and how am I to decide to give a character ID or glyph index if needed to be given in input string, so that the reader will understand the character to print.

If I get a better way forward, I can extend it to cover a larger text.

Output file. https://drive.google.com/file/d/15xEQWuRZALocJT2tTtUAvVK3X4Crd47L/view?usp=drivesdk

Thanks in advance.

0 Answers
Related