Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Openning a png file in ubuntu, I can see the menu item for 'print to file'. How can I do the same on shell? PS: I prefer installing no extra package, due to lack of root access.

EDIT: the operating system is ubuntu 11.10

share|improve this question

convert xyz.png xyz.pdf should do the trick.

See man convert for more options.

share|improve this answer
+1 - additionally you can use wildcards: convert *.png file.pdf – Geppettvs D'Constanzo Jun 30 '12 at 18:49
does this require extra packages? – Richard Jun 30 '12 at 19:27
Yes it requires the ImageMagick package, although it was there by default on my Ubuntu 12.04 – abhshkdz Jun 30 '12 at 19:29
Also there by default on lubuntu 12.10. – Rasmus Nov 23 '12 at 7:59
Be careful if you use wildcards, files might not appear in the desired order, especially if filenames contain numbers (for example, a file named 17.png will precede a file named 2.png). To preview the order in which they will be merged into the pdf file, you can use the command echo *.png. – user396895 Apr 10 '15 at 20:24

Your Answer


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.