How does convert combine pdf files into one?

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
Tim
Posts: 14
Joined: 2014-11-15T12:39:34-07:00
Authentication code: 6789

How does convert combine pdf files into one?

Post by Tim »

Code: Select all

convert 1.pdf 2.pdf 3.pdf my.pdf 
The sizes of 1.pdf, 2.pdf, 3.pdf and my.pdf are 1.4MB, 1.9MB, 2.2MB and 3.7MB respectively.

I found the quality of 3.pdf has been deterioated significantly, and 3.pdf is the one with the largest size in pixels.

So I wonder how does convert combine pdf files into one?

Is it possible to combine pdf files without the negative side effects?

Thanks.
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: How does convert combine pdf files into one?

Post by snibgo »

I suppose your inputs are vector, perhaps including text. "Convert" will take every page of each input, rasterising each page (ie converting the page to an image of dots). For the output, it combines all of these raster images into a single pdf.

IM is a raster image processor. If all you want to do it to append each input pdf into a single output pdf, it is the wrong tool for the job.
snibgo's IM pages: im.snibgo.com
Tim
Posts: 14
Joined: 2014-11-15T12:39:34-07:00
Authentication code: 6789

Re: How does convert combine pdf files into one?

Post by Tim »

snibgo wrote:I suppose your inputs are vector, perhaps including text. "Convert" will take every page of each input, rasterising each page (ie converting the page to an image of dots). For the output, it combines all of these raster images into a single pdf.

IM is a raster image processor. If all you want to do it to append each input pdf into a single output pdf, it is the wrong tool for the job.
My inputs are raster images.

What is "IM"? Is it Imagick or a command/executable?

What tools to append pdf files? pdftk?
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: How does convert combine pdf files into one?

Post by fmw42 »

IM is an abbreviation for Imagemagick. Imagemagick is not the same as Imagick. Imagick is an API that makes calls to ImageMagick.

This is an Imagemagick (IM) forum. If you want to discuss Imagick, then use that forum, listed further down the main page.
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: How does convert combine pdf files into one?

Post by snibgo »

Yes, IM is an abbreviation of ImageMagick.
Tim wrote:My inputs are raster images.
In that case, perhaps you are not using the correct "-density" setting before each PDF.
snibgo's IM pages: im.snibgo.com
Tim
Posts: 14
Joined: 2014-11-15T12:39:34-07:00
Authentication code: 6789

Re: How does convert combine pdf files into one?

Post by Tim »

snibgo wrote:Yes, IM is an abbreviation of ImageMagick.
Tim wrote:My inputs are raster images.
In that case, perhaps you are not using the correct "-density" setting before each PDF.
I remember I read it somewhere that -density only specify the spatial resolution, and it shouldn't degrade the iamge quality. Correct?

Or do you mean the density used for re-rasterizing the individual pdf files? If yes, how shall I figure out what density is used for combine the individual pdf files?
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: How does convert combine pdf files into one?

Post by fmw42 »

Perhaps it might be useful for you to identify the version of Imagemagick, Ghostscript delegate that is being used for PDFs and your platform. You may need an upgrade to Ghostscript or IM.
Tim
Posts: 14
Joined: 2014-11-15T12:39:34-07:00
Authentication code: 6789

Re: How does convert combine pdf files into one?

Post by Tim »

fmw42 wrote:Perhaps it might be useful for you to identify the version of Imagemagick, Ghostscript delegate that is being used for PDFs and your platform. You may need an upgrade to Ghostscript or IM.
imagemagick 8:6.6.9.7-5ubuntu3.3

ghostscript 9.05~dfsg-0ubuntu4.2
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: How does convert combine pdf files into one?

Post by fmw42 »

Also it might be useful for you to post the first 3 or 4 pdfs to some place like dropbox.com and put their URLs here so one of us can try duplicating your problem. Also what do you mean by degraded? In size, in sharpness, in color?

6.6.9.7 is ancient. IM is now at 6.8.9.10, so you are about 200 versions old.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: How does convert combine pdf files into one?

Post by fmw42 »

The problem with raster pdfs is that the resolution of the image in the pdf may be different from the resolution of the vector shell of the pdf. That makes it hard to combine and maintain good "quality/resolution", unless you extract the images first and then combine them into one final pdf. IM cannot extract the image from a pdf, so you need to find some external tool to do that. They do exist.
Tim
Posts: 14
Joined: 2014-11-15T12:39:34-07:00
Authentication code: 6789

Re: How does convert combine pdf files into one?

Post by Tim »

fmw42 wrote:Also it might be useful for you to post the first 3 or 4 pdfs to some place like dropbox.com and put their URLs here so one of us can try duplicating your problem. Also what do you mean by degraded? In size, in sharpness, in color?

6.6.9.7 is ancient. IM is now at 6.8.9.10, so you are about 200 versions old.
by "degrade", I mean I can't figure out what words in teh part of 4.pdf corresponding to 3.pdf are no matter how much I zoom 4.pdf.
pipitas
Posts: 168
Joined: 2012-07-15T14:06:46-07:00
Authentication code: 15

Re: How does convert combine pdf files into one?

Post by pipitas »

fmw42 wrote:The problem with raster pdfs is that the resolution of the image in the pdf may be different from the resolution of the vector shell of the pdf. That makes it hard to combine and maintain good "quality/resolution", unless you extract the images first and then combine them into one final pdf. IM cannot extract the image from a pdf, so you need to find some external tool to do that. They do exist.
I think you misunderstand:
  1. There is no need to extract images from a PDF.
  2. He has his images already: PNGs and JPEGs (of different sizes).
  3. Tim wants to combine all his images into a single multi-page PDF.
pipitas
Posts: 168
Joined: 2012-07-15T14:06:46-07:00
Authentication code: 15

Re: How does convert combine pdf files into one?

Post by pipitas »

pipitas wrote:
fmw42 wrote:The problem with raster pdfs is that the resolution of the image in the pdf may be different from the resolution of the vector shell of the pdf. That makes it hard to combine and maintain good "quality/resolution", unless you extract the images first and then combine them into one final pdf. IM cannot extract the image from a pdf, so you need to find some external tool to do that. They do exist.
I think you misunderstand:
  1. There is no need to extract images from a PDF.
  2. He has his images already: PNGs and JPEGs (of different sizes).
  3. Tim wants to combine all his images into a single multi-page PDF.
Sorry -- it's clear that I have misunderstood here :-)

I confused this thread opened by Tim with the other one opened by Tim. Though, most likely, both threads deal with the same task he faces -- he originally had 250 PDFs, which he meanwhile converted to individual PDF pages...
Post Reply