title: generating Persian PDF with iText
body: <p>Hi <br> I know that many people may have asked this question before. I've read almost all of them`but it couldn't help me solve my problem. <br> I'm using iText java library to generate a Persian PDF. I'm using the following code:</p>
  
  <pre><code>Document document = new Document(PageSize.A4,50,50,50,50);
  FileOutputStream fos = new FileOutputStream("D:\\ITextTest.pdf");
  PdfWriter writer = PdfWriter.getInstance(document,fos);
  document.open();
  BaseFont bf = BaseFont.createFont("C:\\Windows\\Fonts\\XB YagutBd.ttf", BaseFont.IDENTITY_H, BaseFont.EMBEDDED);
  Font a = new Font(bf,10);
  Paragraph p1 = new Paragraph("سلام دوست من");
  p1.setFont(a);
  document.add(p1);
  document.close();
  </code></pre>
  
  <p>But when I execute the code, nothing has been written to the PDF file and it's blank. Note that "XB YagutBd.ttf" is a Persian Unicode font and "p1" contains some Persian characters.</p>
  
  <p>What should I do? I've gotten stuck in this problem... help me please.</p>