如果不是大量照片,则可以使用TeX / LaTeX创建PDF。然后,您仍然可以获得相同的结果(图像pdf),而不会出现转换器崩溃的问题。TeX上的文件限制应仅是您的系统(硬件+ OS)
但是我认为您可以使用Shell脚本编写TeX:
0)
mkdir convert
pushd convert
PATH=convert:$PATH /* keep everything in one directory for tidyness.*/
1)制作一个模板
1.1)我敢肯定,有一种方法可以通过使用变量替换图像名称并插入而不是追加来一次性完成此步骤,并格式化$ FOO使其具有正确的前导0,但是以下正是我所知道的。
1.2)模板需要拆分以便脚本插入文件名
1.3)nano tmplt1 / *或您选择的编辑器* /
/* white space line */
\begin{figure}[h!]
\includegraphics[width=0.5\linewidth]{
/* at this point the script will insert $FOO, the file name variable */
1.3.1)但是,您的文件转到0001.miff…0010.miff…0100.miff…2000.miff。即可变数量的前导零。解决方法:tmplt1的4个版本:tmplt1-9,tmplt10-99,tmplt100-999,tmplt1000-2000。Tmplt1-9以“ ... width] {000”结尾(即加3 0);tmplt10-99以“ ... width] {00”结尾(即加2 0)。100-999加1零,而1000-2000与tmplt1相同
1.4)模板的下一部分:nano tmplt2 / * OEOYC * /
.miff}
\caption{ /* if you want to caption, otherwise skip to tmplt3.
Same again, script will insert $FOO here */
1.5)模板的下一部分:nano tmplt3 / * OEOYC * /
}
\label{f: /*if you want them labelled which is actually
a index/reference for the text to refer to, not a caption.
Same again, the script will insert $FOO here. If you do not
want labels, skip to tmplt4*/
1.6)下一个模板:nano tmplt4 / * OEOYC * /
}
\end{figure}
2)开始文件:nano head / * OEOYC * /
\documentclass{article} /* Or more suitable class */
\usepackage{graphicx}
\begin{document}
/* white space line*/
3)结束文件:nano foot / * OEOYC * /
\end {document}
4)编写脚本:nano loader / * OEOYC * /
#! /bin/bash
cat head > out.pdf
for FOO in {1...9}
do
cat tmplt1-9 >> out.pdf
echo "$FOO" | cat >> out.pdf
cat tmplt2 >> out.pdf
echo "$FOO" | cat >> out.pdf
cat tmplt3 >> out.pdf
echo "$FOO" | cat >> out.pdf
cat tmplt4 >> out.pdf
done
for FOO in {10...99}
do
cat tmplt10-99 >> out.pdf /* this looks like a lot but
is actually copy-paste of first block, just add relevant 0's and 9's */
echo "$FOO" | cat >> out.pdf
cat tmplt2 >> out.pdf
echo "$FOO" | cat >> out.pdf
cat tmplt3 >> out.pdf
echo "$FOO" | cat >> out.pdf
cat tmplt4 >> out.pdf
done
for FOO in {100...999}
do
cat tmplt100-999 >> out.pdf
echo "$FOO" | cat >> out.pdf
cat tmplt2 >> out.pdf
echo "$FOO" | cat >> out.pdf
cat tmplt3 >> out.pdf
echo "$FOO" | cat >> out.pdf
cat tmplt4 >> out.pdf
done
for FOO in {1000...2000}
do
cat tmplt1000-2000 >> out.pdf
echo "$FOO" | cat >> out.pdf
cat tmplt2 >> out.pdf
echo "$FOO" | cat >> out.pdf
cat tmplt3 >> out.pdf
echo "$FOO" | cat >> out.pdf
cat tmplt4 >> out.pdf
done
cat foot >> out.pdf
5)使脚本可执行:chmod u + x loader
5.1)经过测试之后,我发现每次插入$ FOO时,它就会分布在3行中。除了进入脚本并手动删除回车符外,我不知道其他解决方法。至少所有2000张照片中只有36张
6)调用脚本:加载程序
7)编译TeX:pdflatex out.pdf