title: how to string (html) convert to pdf file and send API in android
body: <p>I have a html string.I want to convert  string to pdf file and try to post.Function not return File.How to resolve this issue.</p>
  
  <pre><code>public static void pdf (String html) {
  
      // step 4
      try {
          Document document = new Document();
          // step 2
          InputStream in = new ByteArrayInputStream(html.getBytes());
          PdfWriter writer = PdfWriter.getInstance(document, new FileOutputStream("test.pdf"));
          // step 3
          document.open();
          XMLWorkerHelper.getInstance().parseXHtml(writer, document,
                  in);
          document.close();
          Log.e("test",  "PDF Created!" );
      } catch (Exception e) {
          e.printStackTrace();
      }
  }  
  </code></pre>