Using ImageMagick I can convert any pdf document into images by using command "convert":
convert abc.pdf abc.png
This will convert all pdf pages to png images.
How can I implement this using PHP or Java so that I can provide this functionality on my website to enable users to read books online as Google Books does.