Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Closed 10 years ago.
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
接受
或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
发布评论
评论(3)
我不确定这在 ImageMagick 中是否可行。
对于 TIFF,您需要做的是从一个 TIFF 中读取 TIFF 目录,并在要附加的目录中创建新目录,然后通过缓冲区复制编码图像。不需要解码图像来执行此操作,但您必须小心正确地执行此操作并引入与页面关联的任何目录(例如关联的元数据)。
我认为 libtiff(ImageMagick 包装的)提供的函数可以帮助您做到这一点。
对于 PDF,这也很难 - 此页面有一些替代方案:
http:// ansuz.sooke.bc.ca/software/pdf-append.php
还有许多可以操作 PDF 的第 3 方 SDK(ActivePDF、PDFTron、Amyuni)。
免责声明:我在 Atalasoft 工作:我们有一个 .NET SDK,它具有 TIFF(和图像)的此功能-仅限 PDF)。它可以通过 C++/CLI 调用,但不确定你是否在 Windows 上。
I'm not sure it's possible in ImageMagick.
For TIFF, what you need to do is read TIFF Directories out of one TIFF and create new ones in the one you are appending to, and then copy the encoded image via a buffer. There is no need to decode the image to do this, but you have to be careful to do it correctly and bring over any of the directories associated with the page (like the associated meta-data).
I think that libtiff (which ImageMagick wraps) provides functions that can help you do this.
For PDF, it's also hard -- this page has some alternatives:
http://ansuz.sooke.bc.ca/software/pdf-append.php
There are also many 3rd party SDKs that can manipulate PDF (ActivePDF, PDFTron, Amyuni).
Disclaimer: I work for Atalasoft: we have a .NET SDK that has this functionality for TIFF (and image-only PDF). It can be called via C++/CLI, but not sure if you are on Windows.
实际上我昨天刚刚经历过这个问题。 Ghostscript 的附加速度要快得多。
首先 cd 进入包含要附加到 pdf 的 tiff 的目录
然后
另请参阅 http://www.novell.com/coolsolutions/tools/17083。 html
I actually just struggled through this yesterday. ghostscript is much much faster to append with.
first cd into the directory that is holding the tiffs that you want to append to pdf
then
also look at http://www.novell.com/coolsolutions/tools/17083.html
使用 Imagemagick 创建多页 PDF 非常容易。这并不完全是问题的答案,但我在谷歌上搜索的答案......
无论如何......使用 ImageMagick 将 3 个图像转换为一个 3 页的 PDF:
With Imagemagick it's quite easy to create a multi page PDF. This is not completely the answer to the question, but the answer I was Googling for...
Anyways... To convert 3 images to one 3-page PDF using ImageMagick: