fmw42 wrote:Suggestion, see if it happens if you use some other compression method. Also is there a smaller limited number of input files that work?
Thank you for suggesting this!
Trying around...
Converting 404 (7GB in total) .tif files to .pdf with zip compression:
Code: Select all
convert -density 300 -limit memory 0 -limit map 0 *tif -compress zip tif2zip.pdf
convert: unable to extend cache `in9192.tif': No space left on device @ error/cache.c/OpenPixelCache/3719.
convert: unable to extend cache `in9193.tif': No space left on device @ error/cache.c/OpenPixelCache/3719.
[...]
this is with /tmp/ being 4.0G in size.
If I run it as
Code: Select all
MAGICK_TMPDIR=/home/qubodup/it/ convert -density 300 -limit memory 0 -limit map 0 *tif -compress zip tif2zip.pdf
while having 43G available, it will also run out of size.
Converting 404 Gray & sRGB jpeg files (size: 3923x4557) between 0.5 and 9MB in size each, 2.7G total.
Code: Select all
$ convert -density 300 *jpg -compress zip jpgtozip.pdf
Killed
Another try:
Code: Select all
convert -density 300 -limit memory 0 -limit map 0 *jpg -compress none jpg2none.pdf
convert: unable to extend cache `in9192.tif': No space left on device @ error/cache.c/OpenPixelCache/3719.
[...]
It seems like all these messages just indicate running out of storage space, although only the zip compression seems to give a clear error message.
Solution
The end result file would probably be too huge for me, so rather than trying to work with subsets, I scaled down the images to 1961x2278 and converted them to pdf with jpeg or zip compression,
based on their colorspace (jpeg seems to be ineffective for greyscale b/w) and then merged into one pdf file successfuly using pdfjoin
Code: Select all
for file in *tif; do
FORMAT=`identify -format %[colorspace] $file`
if [ $FORMAT = "Gray" ]; then
COMPRESSION=zip
else
COMPRESSION=jpeg
fi
convert $file -density 72 -compress $COMPRESSION $file.pdf
echo $file done
done
pdfjoin --outfile 404pages.pdf *pdf
The size of all tif files is 2042M.
The size of all pdf files is 275M.
The joined pdf size file is 272M.