Page 1 of 1

Append is no longer working

Posted: 2013-04-01T12:15:28-07:00
by tin_acton
I use the following command in a script once a month for batch conversions:

Code: Select all

convert -size 612x792 -density 150 $i -append png8:"${i/.pdf}".png
This month is was brought to my attention that only the first page is appearing. When I looked closer all I see are multi-paged PNG files, but not a single PNG file that contains the entirety of the original PDF.

When I convert to JPG or GIF, I get a single paged image file.

I don't see anything wrong with the syntax and nothing else in the workflow changed, so I'm not sure why append is suddenly no longer working.

EDIT: Works as it should on Windows 8. The above problem appears to occur only on OS X 10.7 with ImageMagick installed through Ports.

Re: Append is no longer working

Posted: 2013-04-01T13:09:57-07:00
by fmw42
What is $i?

Is it an index or a given multipage file or a list of files?

Please clarify your problem and give a better example with images substituted. How are you looping over your input images or is it just one image with multiple pages such as a pdf.

Note PNG does not support a single multi-page file structure. It will create one output file when using -append that will stack all the pages vertically in the output.

This works fine for me under IM 6.8.4.5 Q16 Mac OSX Snow Leopard.

# create multi-page pdf
convert rose: rose: rose: rose.pdf

# vertically append all the pages into one single png
convert rose.pdf -append rose_append.png

Re: Append is no longer working

Posted: 2013-04-01T13:35:10-07:00
by tin_acton
How are you looping over your input images or is it just one image with multiple pages such as a pdf.
Sorry for the confusion, here is a section of the relevant script:

Code: Select all

#!/bin/bash
for i in `ls *.pdf`
  do
        convert -size 612x792 -density 150 02-05-13_951.pdf -append png8: "${i/.pdf}".png;
done
It would be similar to this:

Code: Select all

        convert -size 612x792 -density 150 file_input.pdf -append png8:file_output.png
Note PNG does not support a single multi-page file structure.
I must have been incorrect in my observations - I'm not sure what I was previously looking at if this is the case. Please ignore. Original problem persists with single page.

Re: Append is no longer working

Posted: 2013-04-01T14:32:41-07:00
by fmw42
convert -size 612x792 -density 150 02-05-13_951.pdf -append png8: "${i/.pdf}".png;
This may be a typo but there should be no space after PNG8: and the output.

try my example above and see if it works or not. What version of IM are you using? What is the version of Ghostscript that is needed to read the pdf file?