I am trying to create a .pdf from a series of .tiff images. What images are selected is the product of a query (from Oracle), not a pick-list or traditional means. This is running on Linux so two tools at my disposal are CPTIFF which puts several .tiff images into one file and TIFF2PDF, which takes the output of CPTIFF and creates a .pdf from it. The use of the app will always produce a pdf with multiple images.
What I need to be able to do is feed the result of the query to CPTIFF and then the result of CPTIFF to TIFF2PDF. Something like:
shell_exec('cptiff image1.tiff image2.tiff image3.tiff all_images.tif');
shell_exec('tiff2pdf -o output.pdf all_images.tif');
The problem: How do I feed the query result to cptiff as a single line separated by blanks. I am used to looping through and creating a table as output, not feeding the results to the OS.
Any help would be greatly appreciated. 🙂