title: how to create Persian PDF with iText
body: <p>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. 
  I'm using iText java library to generate a Persian PDF. I'm using the following</p>
  
  <p>how to use <code>PdfWriter.RUN_DIRECTION_RTL</code></p>
  
  <p>code: </p>
  
  <pre><code>String ruta = txtruta.getText();
      String contenido= txtcontenido.getText();
      try {
          FileOutputStream archivo = new FileOutputStream(ruta+".pdf");
          Document doc = new Document(PageSize.A4,50,50,50,50);
            PdfWriter.getInstance(doc, archivo);
            doc.open();
            BaseFont bfComic = BaseFont.createFont("D:\\Font\\B Lotus.ttf", BaseFont.IDENTITY_H,BaseFont.EMBEDDED);
            Font font = new Font(bfComic, 12,Font.NORMAL);
             doc.add(new Paragraph(contenido,font));
         doc.close();
         JOptionPane.showMessageDialog(null,"ok");
  
      } catch (Exception e) {
          System.out.println("Eroor"+e);    
      }
  </code></pre>
  
  <p><strong>Output:</strong>
  <a href="http://i.stack.imgur.com/mcR9E.png" rel="nofollow">Problem</a></p>