Reputation: 105
I have a massive number of TIFF images which are single scanned pages. They are each a page of multi-page documents.
I need to be able to deliver this multi-page document to my users as a PDF. Nothing special is required except combining the images into one document, in the right order.
The images locations are provided via the result of a MySQL query in PHP as an array, i.e:
c:\images\04\DUDDSDFF.tif,c:\images\04\EDFRTOFN.tif,c:\images\04\EFSDOSDG.tif
The current dev environment I am working in uses XAMPP running on Win Server 2K3.
Any suggestions/solutions would be most appreciated.
Cheers
Upvotes: 0
Views: 2457
Reputation: 1
The answer from @chariothy is close but doesn't actually work. I just had a need to combine multiple tif files into a single pdf file and this is my solution, tested and working.
$pdf = new \Imagick();
foreach ($tif_file_paths as $file_path){
$pdf->addImage(new \Imagick($file_path));
}
$pdf->writeImages('path/to/save/file/test-combined.pdf', true);
Upvotes: 0
Reputation: 320
$pdfThumb = new \Imagick();
foreach ($tiffPics as $tiffPic) {
$pdfThumb->addImage($new \Imagick($tiffPic));
}
$pdfThumb->writeImages($absolutePdfName, true);
Upvotes: 0