Skip to main content

Command Palette

Search for a command to run...

PDF to PNG to PDF on macOS using ImageMagick

Updated
1 min read
PDF to PNG to PDF on macOS using ImageMagick

ImageMagick is an awesome command line tool for working with images.

Convert PDF to PNG files with magick

Convert a multi-page PDF file to PDFs with ImageMagick using the following command:

magick density -300 input.pdf -resize 30% outdir/output.png

You can adjust the density and resize values for your preferred file size and quality.

Combine PNG files to PDF in Finder

Select all output PNG files, right click, go to Quick Actions → Create PDF.

Improving this

Can this be done with just ImageMagick?

I did attempt the following command but the images were smaller than ideal.

cd outdir
magick *.png -scale 1311x1819 \
    -units PixelsPerInch \
    -density 300x300 output.pdf

Doing it all with ImageMagick would make this easier to script.

References

More from this blog

T

Tinacious Design Blog

47 posts