title: Android: PdfDocument generates empty pdf
body: <pre><code>        PdfDocument document = new PdfDocument();
          // crate a page description
          PageInfo pageInfo = new PageInfo.Builder(300, 300, 1).create();
          // create a new page from the PageInfo
          Page page = document.startPage(pageInfo);
          // repaint the user's text into the page
          View content = findViewById(R.id.textarea);
          content.draw(page.getCanvas());
          // do final processing of the page
          document.finishPage(page);
          try {
               File f = getPDFPath();
               FileOutputStream fos = new FileOutputStream(f);
               document.writeTo(fos);
               document.close();
               fos.close();
  
          } catch (IOException e) {
              throw new RuntimeException("Error generating file", e);
          }
  </code></pre>
  
  <p>Where <code>findViewById(R.id.textarea);</code> refers to a <code>TextView</code> with some text, but the above code generates only empty pdf. What can be the issue?</p>
  
  <p>is there any link that have working sample of generating pdf using Android native API?</p>