S_S
S_S

Reputation: 1412

iText PDF A-2 with English and Hindi Fonts

I am using PdfAWriter to create a PDF A-2 document as below

PdfAWriter writer = PdfAWriter.getInstance(document, new FileOutputStream(dest), PdfAConformanceLevel.PDF_A_2A);

For adding text I am using TTF fonts like this

Font font8 = new Font(BaseFont.createFont(FONT, BaseFont.IDENTITY_H, BaseFont.EMBEDDED), 8);

I need to create a PDF A-2 file with both English and Hindi fonts. For English I use OpenSans-Regular.ttf and for Hindi I can use Kruti_Dev_010.ttf, but if I use Kruti_Dev_010.ttf it does not render anything in English.

How can I create a PDF with both English and Hindi text?

Upvotes: 1

Views: 836

Answers (1)

Peter Constable
Peter Constable

Reputation: 3650

Google Fonts has fonts that support Devanagari script and also Basic Latin characters.

Upvotes: 1

Related Questions