【发布时间】:2013-09-11 00:40:44
【问题描述】:
我已经搜索了一段时间,找不到明确的答案。
我有一个包含图片的文件夹: 001.png、002.png ....等
我尝试过的。
$allImages = 'folder/001.png folder/002.png folder/003.png';
//and
$allImages = 'folder/001.png,folder/002.png,folder/003.png';
//and
$allImages = '-adjoin folder/001.png -adjoin folder/002.png -adjoin folder/003.png';
然后:
exec(convert $allImages folder/newdoc.pdf);
//and
exec(convert -density 150 -format pdf{} ".$all_images folder/newdoc.pdf);
这只会将一页放入 pdf 中,并且 pdf 的标题为 png,因此 pdf 查看器确实无法阅读。
我不想使用 (convert *.png newdoc.pdf),因为我需要按特定顺序的 pdf。编辑:这也不起作用。
【问题讨论】:
-
尝试将它们设置在一个数组中,例如
$allImages = array("folder/001.png", "folder/002.png", "folder/003.png");并且不查看您的整个代码或不知道您正在使用哪个 PDF 库,除此之外很难详细说明。 -
谷歌搜索
imagemagick multiple files to pdf提供了许多解决方案。你都试过了吗? -
@pekka,几乎所有的解决方案都带有我不想要的通配符。
-
@Fred 我正在使用 Imagick