Redefine the equation
environment to sandwich the math expression with \preview$\displaystyle
and $\endpreview
.
Method 1
\documentclass{article}
\usepackage{amsmath}
\usepackage[tightpage,active]{preview}
\PreviewBorder=3pt\relax
\renewenvironment{equation}
{\preview$\displaystyle}
{$\endpreview}
\begin{document}
This is a theorem in calculus.
\begin{equation}
F(b)-F(a)=\int_a^b f(x)\, \textrm{d}x
\end{equation}
Do you know it?
\begin{equation}
E\ne mc^2
\end{equation}
\end{document}
Method 2
\documentclass[preview,border=3pt,varwidth,multi]{standalone}
\usepackage{amsmath}
\renewenvironment{equation}
{\preview$\displaystyle}
{$\endpreview}
\begin{document}
This is a theorem in calculus.
\begin{equation}
F(b)-F(a)=\int_a^b f(x)\, \textrm{d}x
\end{equation}
Do you know it?
\begin{equation}
E\ne mc^2
\end{equation}
\end{document}


PDF to PNG conversion
To convert all PDF pages to PNG images, use ImageMagick's command as follows.
convert -compose copy -bordercolor magenta -border 1x1 -density <value> -alpha <option> input.pdf output%02d.png
Remark:
value
is an interger. Use bigger/smaller value to enlarge/shrink the image.
option
can be one of 3 options: on
(enable transparency) , off
(disable transparency, but it produces bad output) , remove
(remove transparency with good output).
%02d
means the output filename will be followed by 2 digit numbers. For example: output01.png
, output02.png
, ... output69.png
.