title: how to save flextable as png in R
body: <p>I already followed the recommendation of the link: <a href="https://stackoverflow.com/questions/43664234/r-save-flextable-as-html-file-in-script">R save FlexTable as html file in script</a>, but it seems that I am facing a different problem, because this solution did not work for me. The <code>vanilla.table ()</code> function generates an object other than the <code>flextable ()</code> function.</p>
  
  <p>I'm using <code>flextable</code> because it allows for desirable formatting possibilities</p>
  
  <p>Example:</p>
  
  <pre><code>library(flextable)
  library(rtable)
  
  # The example below work.
  myft &lt;- vanilla.table(
     head(mtcars) )
  myft
  writeLines(as.html(myft), "MyFlexTable.html")
  
  # The example below does not work.
  myft &lt;- regulartable(
    head(mtcars), 
    col_keys = c("am", "carb", "gear", "mpg", "drat" ))
  myft
  writeLines(as.html(myft), "MyFlexTable.html")
  </code></pre>
  
  <p>ps: I know it is possible to download the photo manually by clicking on "Export> Save as Image", however I need it programmed</p>
  
  <p>thanks in advance!</p>