Converting large number of tifs to pdf efficiently?
Posted: 2013-04-26T09:14:40-07:00
We have a project that requires us to take an uploaded zip file and convert the 100+ tifs and pdfs inside to a single pdf document. I've written a simple shell script to do this and it works fine, except that it completely thrashes the machine and has locked up one of our production servers on multiple occasions... The files are all named something like xxx-01.tif and I have to sort them by the last part after the -, then convert them in that order to a pdf, so the actual convert command looks something like
convert file-01.tif file-02.tif file-03.tif ... file-101.tif outputfile.pdf
I'm guessing that perhaps image magick is sucking all of these source tifs into ram and that's why things are going haywire (or just that the cpu is being thrashed). But regardless, is there any way I can accomplish this without completely destroying the server? Like maybe convert them one at a time and append, or some other strategy?
convert file-01.tif file-02.tif file-03.tif ... file-101.tif outputfile.pdf
I'm guessing that perhaps image magick is sucking all of these source tifs into ram and that's why things are going haywire (or just that the cpu is being thrashed). But regardless, is there any way I can accomplish this without completely destroying the server? Like maybe convert them one at a time and append, or some other strategy?