First, put the your FreeSans.ttf file in the assets forlder. iText library takes the file path of the font file so you cannot just give the assets path to it since you cannot directly access assets folder. Following is the code to copy your font file from the assets folder to your app's local directory.
public static final String HINDI_FONT = "FreeSans.ttf";
try {
File file = new File(getFilesDir(), HINDI_FONT);
if (file.length() == 0) {
InputStream fs = getAssets().open(HINDI_FONT);
FileOutputStream os = new FileOutputStream(file);
int i;
while ((i = fs.read()) != -1) {
os.write(i);
}
os.flush();
os.close();
fs.close();
}
} catch (IOException e) {
e.printStackTrace();
}
Execute the try block code in a separate thread, do not do this in the main thread.
The if statement insures that this happens only once. Please write the stream close statements in finally block instead of try block as shown above.
Next is the itext statements to use the font
Font f = FontFactory.getFont(getFilesDir() + "/" + HINDI_FONT, BaseFont.IDENTITY_H, BaseFont.EMBEDDED);
PdfPCell eCell = new PdfPCell(new Phrase(entry, f));
eCell.setPadding(5);
table.addCell(eCell);
Here, the varaible entry is your hindi text and the code is written in an Activity so getFilesDir() works. I have added a phrase in a table cell. You can use it similarly in a paragraph as well. I have checked this code and it works.