How do I convert a PNG to PDF with only the default packages on 11.10?

128,164

Solution 1

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

See man convert for more options.

Solution 2

If you want to convert multiple images, e.g. png files, into one single pdf use convert with the specified pdf filename at the end

convert *.png mydoc.pdf

It will merge all png files into a sinlge mydoc.pdf file in a descendant order.

Solution 3

In 18.04 LTS, open image using ImageViewer; then print to file as a PDF.

Share:
128,164

Related videos on Youtube

Richard
Author by

Richard

Updated on September 18, 2022

Comments

  • Richard
    Richard almost 2 years

    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

  • Geppettvs D'Constanzo
    Geppettvs D'Constanzo about 12 years
    +1 - additionally you can use wildcards: convert *.png file.pdf
  • Richard
    Richard about 12 years
    does this require extra packages?
  • Johan Larsson
    Johan Larsson over 11 years
    Also there by default on lubuntu 12.10.
  • DmiN
    DmiN about 9 years
    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.
  • davidmw
    davidmw about 5 years
    If you're using more recent versions of Ubuntu, you probably need to make this security exception: askubuntu.com/questions/1081895/… PDF looks beautiful, original images are unharmed.
  • e-info128
    e-info128 over 4 years
    convert-im6.q16: not authorized `h1.pdf' @ error/constitute.c/WriteImage/1037.
  • mathtick
    mathtick about 4 years
    convert-im6.q16: attempt to perform an operation not allowed by the security policy `PDF' @ error/constitute.c/IsCoderAuthorized/408.
  • EliuX
    EliuX about 4 years
    It seems more like a problem of a security policy of the environment you are working on. Sorry, I cannot say too much about that error.
  • artless noise
    artless noise over 3 years
    Batch conversion of png to pdf has details on the 'convert-im6.q16' issue.
  • Axel B
    Axel B almost 3 years
    Thank you for your link, artless noise, the accepted answer worked fine for me !