0
votes

I've 9 high quality PDF files. I want to merge them into one large PDF of 3x3. I then want to turn this into a PNG file. 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. I thought I might do this with imagemagick but I'm struggling. 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:

1) https://www.dropbox.com/s/qc094jg1nkfk0jw/input_1.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

Each PDF is 1071 x 1800 pts (using pdfinfo).

Thanks

James

1

1 Answers

1
votes

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:

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%