Forum How do I...?

Create JPEG Preview image with PHP wrapper

dvalle
Hello,

I am using the PHP wrapper and what I am looking to do is create a JPG preview image before I generate the PDF. I looked at the docs and I can only see an example from the command line. Is there an example of how I can do this with PHP on a web page?

Thank you.
mikeday
There isn't a PHP API for this yet, but it wouldn't be too tricky to add this, we will take a look.
dvalle
Is there another way to implement a JPG preview then? I'm not a seasoned developer, but would it be something with php_exec() function to trigger the command line?
mikeday
If you wish to create the JPEG image as well as the PDF then you could call the setOptions() method in the PHP wrapper and pass the additional raster options there, before calling the appropriate convert method.