These are all interesting approaches, and I may consider one or more of them. Still debating whether the cost of the DynaPDF plugin is worth it for this small slice of functionality.
Thanks for putting in all the thought!
– Kimball
[quote=220848:@Julio Debroy]Kimball, a crazy idea…
Yesterday I was thinking about your request, and indeed verified that you need to purchase a license one way or another, for one of the available pdf libraries. But it seemed to me an interesting challenge.
One of the options I think is good, is to get the MBS Xojo plugin for imagemagick. Since imagemagick needs ghostscript anyway to open the pdf, you can avoid distribution problems making by the final user download and install ghostscript. In that way you are not violating any license and your app can use the functionality.
The other option is DynaPDF, but I think that if you get the MBS Xojo plugin you also have to pay a license to DynaPDF. Am not sure, maybe Christian can confirm that.
Now my crazy idea. I was fiddling last night and found a javascript library that can indeed load and render a pdf in a HTMLView window, both in mac and in Windows. For windows the native renderer is IE, and for Mac is Webkit as far as I know.
In any case, you can download the pdf into the htmlview and then there is another library that can render (print or save) to an image whatever you have in the htmlview. Once you have the pdf rendered into a HTML5 canvas, you can save it using some techniques.
This approach will need you to get the pdf via javascript or similar.
Another approach is to make the user install adobe acrobat reader, and use the functionality embedded in the COM activeX object (only for Windows) to read the pdf and render it to a canvas that you can later save to an image file. In this case you have to link the COM interface.
https://mozillalabs.com/en-US/pdfjs/
http://www.codediesel.com/javascript/rendering-pdf-in-html5-canvas/
http://stackoverflow.com/questions/12796513/html5-canvas-to-png-file
http://www.permadi.com/tutorial/save-canvas/test-save-html5-canvas.html
http://www.codeproject.com/Articles/32274/How-To-Convert-PDF-to-Image-Using-Ghostscript-API
http://www.codeproject.com/Articles/57100/Simple-and-Free-PDF-to-Image-Conversion[/quote]