Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I'm still learning the command line, and I'm having trouble piping a list of files into graphicsmagick for conversion to pdf:

find . -type f | sort | gm convert file.pdf

This gives the error: gm convert: Request did not return an image.

Can I do this without resorting to more complicated methods?

share|improve this question

1 Answer 1

From the manual,

convert [ options ... ] input_file output_file

So you need to specify your files...

for i in `find . -type f | sort`
do
  gm convert "$i" "$i".pdf
done
share|improve this answer
    
This looks like it will convert each individual file into a pdf. What I need is to convert a group of files into a single pdf. Will this do that? –  user2089518 Apr 13 at 3:43
    
No. You'll need to use some other mechanism to do that. One program that can combine multiple images into a multi-page PDF is xsane. –  Elliott Frisch Apr 13 at 3:47

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.