I have a PHP script that generates a PDF document, then places that PDF into a string to pass to convert as stdin.
These PDFs are press quality, so they tend to be rather large. In order to show the user a low resolution GIF or JPG image I use the following command:
Code: Select all
convert -density 305 -resize 100% -profile 'USWebCoatedSWOP.icc' pdf:-[page#] -profile 'sRGB Color Space Profile.icm' -resample 72 gif:-
This works fine if I only want the first page. If I do not specify a page, it returns the last page. My problem is that when I try to get a page other than the first or last, or I enter the last pages page number, I get an error.
Does anyone know if it is possible to specify the PDF page to convert if the PDF is passed through stdin? I would like to avoid using the PHP API for now if I can. However, I will be forced if someone knows if I can do what I need with the API, and not from the command line.
Any help with this would be greatly appreciated.
Thanks,