ImageMagick将高图像转换为具有相同宽度动态高度的A4 PDF页面

时间:2017-08-03 08:51:32

标签: image-processing imagemagick imagemagick-convert

我们怎样才能将一个高动态的-height -ight-screenshot.png制作成A4文件中的多个页面的onefile.pdf,以便在打印时可以读取?

像这样的例子:

enter image description here

进入A4页面

enter image description here

因此,当我们打印时,就像

enter image description here

不喜欢(不可读)

enter image description here

2 个答案:

答案 0 :(得分:1)

对于原始的第一种方法来说,这可能已经足够了 - 它不会寻找好的位置(空白区域)来划分页面,所以它会切换到第一页底部的图像:< / p>

convert article.jpg -resize 2480x -crop 2480x3508 +repage result.pdf

enter image description here

答案 1 :(得分:0)

在imagemagick中,您可以裁剪为多个页面。但这取决于您是要保留原始尺寸还是调整宽度以对应A4。 A4文件尺寸为595x842。

如果您想保留原始尺寸并创建多页PDF,那么您将以原始分辨率获得12页

convert V0twr.jpg -crop 595x842 +repage onefile1.pdf

如果你想调整到A4的宽度然后裁剪,那么你将以降低的分辨率获得2页。

convert V0twr.jpg -resize 595x -crop 595x842 +repage onefile2.pdf

你可以为你的调整大小选择一些其他中间分辨率,如果你想作为妥协,说两倍宽度A4 = 2 * 595 = 1180

相关问题