I am using iTextG 5.5.3 to generate a Persian pdf file. So I used the following code:
Document document = new Document(PageSize.A4);
PdfWriter.getInstance(document, pdfFileOutputStream);
document.open();
Paragraph p1 = new Paragraph("سلام این متن برای تست است.");
BaseFont farsiFont = BaseFont.createFont("assets/fonts/BMitra.ttf", "UTF-8", BaseFont.EMBEDDED);
Font paraFont= new Font(farsiFont);
p1.setAlignment(Paragraph.ALIGN_CENTER);
p1.setFont(paraFont);
PdfPTable table = new PdfPTable(1);
PdfPCell cell = new PdfPCell(p1);
cell.setRunDirection(PdfWriter.RUN_DIRECTION_RTL);
table.addCell(cell);
document.add(table);
document.close();
But Persian characters aren't written in the output file. I also read this answer.