简体   繁体   English

使用imagemagick平铺/连接高分辨率PDF文件

[英]Tile/concatenate high resolution PDF files with imagemagick

I've 9 high quality PDF files. 我有9个高质量的PDF文件。 I want to merge them into one large PDF of 3x3. 我想将它们合并为一个3x3的大型PDF。 I then want to turn this into a PNG file. 然后,我想将其转换为PNG文件。 I want to keep the resolution/sharpness during this process so that on the resulting PNG I can zoom right in and still see the fine detail. 我想在此过程中保持分辨率/清晰度,以便在生成的PNG上可以放大并仍然看到精细的细节。 I thought I might do this with imagemagick but I'm struggling. 我以为我可以用imagemagick做到这一点,但是我很挣扎。 Any ideas please? 有什么想法吗?

I've tried this to merge them together to start with. 我已经尝试过将它们合并在一起。 It works, but the quality doesn't remain. 它可以工作,但质量无法保持。

montage input_*.pdf -background none -tile 3x3 -geometry +0+0 output.pdf

Please note that file size and size of resulting image isn't an issue. 请注意,文件大小和生成的图像大小不是问题。 I've no need to print it or anything like that. 我不需要打印它或类似的东西。 It's for viewing on a computer only. 仅用于在计算机上查看。

Here is a sample of three of the PDF files: 这是三个PDF文件的示例:

1) https://www.dropbox.com/s/qc094jg1nkfk0jw/input_1.pdf?dl=0 1) https://www.dropbox.com/s/qc094jg1nkfk0jw/input_1.pdf?dl=0

2) https://www.dropbox.com/s/gb4u8r7bxg8lw2r/input_2.pdf?dl=0 2) https://www.dropbox.com/s/gb4u8r7bxg8lw2r/input_2.pdf?dl=0

3) https://www.dropbox.com/s/97dhi42wrvfxfd2/input_3.pdf?dl=0 3) https://www.dropbox.com/s/97dhi42wrvfxfd2/input_3.pdf?dl=0

Each PDF is 1071 x 1800 pts (using pdfinfo). 每个PDF均为1071 x 1800 pts(使用pdfinfo)。

Thanks 谢谢

James 詹姆士

Rather than stick with PDF and then merge and then convert to PNG, you may be better to extract the images as PNG in the first place and then concatenate the PNG files like this: 与其坚持使用PDF,然后合并然后转换为PNG,不如先将图像提取为PNG,然后将PNG文件连接起来,可能会更好:

pdfimages -png input_1.pdf a
pdfimages -png input_2.pdf a
pdfimages -png input_3.pdf a

# Combine them side by side
montage a-*png -background none -tile 3x3 -geometry +0+0 output.png

# Or combine with "convert"
convert a-*.png +append result.png

The second document seems to have a mask... 第二份文件似乎有面具...

pdfimages -list input_1.pdf
page   num  type   width height color comp bpc  enc interp  object ID x-ppi y-ppi size ratio
--------------------------------------------------------------------------------------------
   1     0 image   12000 20167  icc     3   8  image  no         9  0   807   807 1260K 0.2%

pdfimages -list input_2.pdf
page   num  type   width height color comp bpc  enc interp  object ID x-ppi y-ppi size ratio
--------------------------------------------------------------------------------------------
   1     0 image   12000 20167  icc     3   8  image  no         9  0   807   807 5781K 0.8%
   1     1 smask   12000 20167  gray    1   8  image  no         9  0   807   807  230K 0.1%

pdfimages -list input_3.pdf
page   num  type   width height color comp bpc  enc interp  object ID x-ppi y-ppi size ratio
--------------------------------------------------------------------------------------------
   1     0 image   12001 20167  icc     3   8  image  no         9  0   807   807 2619K 0.4%

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM