[Tex/LaTex] converting a table to png using standalone

pngstandalonetables

I am using standalone to convert a table to PNG. I have followed the following example. I got the output in PNG as well, please see the attached. However, when I view it with any of the image viewers (GIMP, IMAGEMAGICK etc), the background is not white. It has black and white square boxes. Surprisingly, here it is with white background. I will be very thankful if some one tell me the solution.

I have followed the following example

\documentclass[convert={density=300,size=1080x800,outext=.png}]{standalone}
\begin{document}
\begin{tabular}{rrrrrrr}
\hline
        Device & 2011 & 2012 & 2013 & 2014 & 2015 & 2016 \\
        \hline
        Non-smarthphones & 22686 & 55813 & 108750 & 196262 & 357797 & 615679 \\
        Smarthphones & 104759 & 365550 & 933373 & 1915173 & 3257030 & 5221497 \\
        Laptops e Netbooks & 373831 & 612217 & 917486 & 1340062 & 1963950 & 2617770\\
        Tablets & 17393 & 63181 & 141153 & 300519 & 554326 & 1083895\\
        Home gateways & 55064 & 108073 & 180562 & 267545 & 376494 & 514777 \\
        M2M & 23009 & 47144 & 92150 & 172719 & 302279 & 508022 \\
        Altri devices & 525 & 1460 & 5429 & 22966 & 84204 & 242681\\
        \hline
\end{tabular}
\end{document}

Output from the code
Screen shot of the GIMP

Best Answer

This is what I call a hack; the standalone class should have a key for passing other options to convert.

\documentclass[
  convert={
    density=300 -alpha deactivate,
    size=1080x800,
    outext=.png
  },
]{standalone}

\begin{document}

\begin{tabular}{rrrrrrr}
\hline
        Device & 2011 & 2012 & 2013 & 2014 & 2015 & 2016 \\
        \hline
        Non-smarthphones & 22686 & 55813 & 108750 & 196262 & 357797 & 615679 \\
        Smarthphones & 104759 & 365550 & 933373 & 1915173 & 3257030 & 5221497 \\
        Laptops e Netbooks & 373831 & 612217 & 917486 & 1340062 & 1963950 & 2617770\\
        Tablets & 17393 & 63181 & 141153 & 300519 & 554326 & 1083895\\
        Home gateways & 55064 & 108073 & 180562 & 267545 & 376494 & 514777 \\
        M2M & 23009 & 47144 & 92150 & 172719 & 302279 & 508022 \\
        Altri devices & 525 & 1460 & 5429 & 22966 & 84204 & 242681\\
        \hline
\end{tabular}
\end{document}

enter image description here

Related Question