A macOS command line tool to build PDFs from JPEG images

Latest Release: 2.3.0

 

Download And Install pdfmaker

You can install pdfmaker using Brew. In Terminal, just run:

brew tap smittytone/homebrew-smittytone

brew install --cask pdfmaker


Alternatively, click the file link below to download pdfmaker.
Please verify the integrity of the download with the SHA-256 checksum.

File Name  pdfmaker_2_3_0.dmg
File Size  103KB
SHA 256  b4994a2a24a909fb10f38190e42e55dad1a73cf13a0bfb4b86d5da3f8c54663b

 

How to Use pdfmaker

pdfmaker is a macOS command line tool which allows you to combine JPEG and other image files into a single PDF file and to extract a series of images from an existing PDF file.

In Terminal, run:

$ pdfmaker --source <image source directory> \
           --destination <pdf save directory/filename.pdf> \
           --compress <amount>

If you omit any of these flags, their default values will be used:

  • Source: The directory from which you ran the tool.
  • Destination: ~/desktop/PDF From Images.pdf.
  • Compression: The native compression of the JPEG source images.

You can use -s, -d and -c as shorthand for the flags above — pdfmaker --help has all the details.

You can also apply the --verbose / -v switch to obtain extra information during conversion.

From version 2.3.0, the switch --createdirs, if used, will create any directories required to write the destination file.

To convert a PDF to a set of images, in Terminal, run:

$ pdfmaker --break \
           --source <path to pdf> \
           --destination <path to folder> \
           --resolution <output dpi value>

You can use -b, and -r as shorthand for the --break and --resolution flags. The -c flag may also be used to compress the output images.

pdfmaker does not delete the source file.

Image Compression

The compression option will compress images before adding them to the PDF. This allows you to reduce the size of the final PDF, as required. Provide an amount in the range 0.0 to 1.0, where 0.0 is maximum compression (lowest quality) and 1.0 is no compression (highest quality).

Note Building a PDF from JPEG files means that you are already using compressed images. If those JPEGs are highly compressed, applying a low compression amount to pdfmaker will not increase image quality but will make your PDF file larger.

Image Resolution

The default output resolution is 72dpi (dots per inch). PDFs store page dimensions as points, rather than pixels, enabling device-independent resolution. pdfmaker determines image pixel dimensions based on the output resolution and the PDF point dimensions. To get correctly sized images out of a PDF, you need to specify the resolution of the images used to source the PDF. You do this be specifying an appropriate output resolution.

For example, a PDF contains a page sourced from a 2600 x 1600 pixel, 300dpi image. Output at 72dpi, this will result in an image of 620 x 400 (2600 * 72 / 300). To get the correct pixel size back, add -r 300 to the command line. This will yield a 2600 x 1600, 300dpi output image.

If you don’t know the source image dpi resolution, experiment with -r values until you get output of the size you require.

Examples

$ pdfmaker --source ~/Documents/'Project X'/Images \
           --destination ~/Documents/PDFs/'Project X.pdf'

This will merge all of the images files in ~/Documents/Project X/Images into a file called Project X.pdf which will be located in ~/Documents/PDFs.

$ pdfmaker --source ~/Documents/'Project X'/Images \
           --destination ~/Documents/PDFs/'Project X.pdf' \
           --compress 0.5

This will merge all of the images files in ~/Documents/Project X/Images into a file called Project X.pdf which will be located in ~/Documents/PDFs. The compilation process will compress images to 50% JPEG quality.

$ pdfmaker --source ~/Documents/'Project X'/Images/cover.jpg \
           --destination ~/Documents/PDFs/'Project X.pdf'

This will convert the image cover.jpg into a file called Project X.pdf which will be located in ~/Documents/PDFs.

$ pdfmaker --break --source ~/Documents/PDFs/'Project X.pdf' \
           --compress 0.4 --resolution 200

This converts Project X.pdf to a series of images that will be written to the desktop (the default destination). This images will be highly compressed and output at a resolution of 200dpi.


Source Code

You can view Pdfmaker’s source code at GitHub.


Release Notes

  • 2.3.0 19 December 2020
    • Add --createdirs switch to create intermediate directories to the specified target.
    • Improved handling of relative paths.
    • Improved argument checking.
    • Make error reporting consistent with imageprep.
    • Write all messages to user via stderr (click here to see why).
    • Correctly trap SIGINT.
    • Add a test suite.
    • Fixed a bug in which target PDFs at non-existent locations were not trapped.
  • 2.2.0 18 November 2020
    • Apple Silicon support.
    • Support adding PNG and TIFFs to PDFs.
    • More informative error reporting.
  • 2.1.0 09 July 2020
    • Add --version switch.
    • Better reporting of bad arguments.
  • 2.0.0 14 November 2019
    • Add PDF-to-images functionality.
  • 1.1.0 28 October 2019
    • Allow the user to select a single source image, not just source directories.
    • Allow the user to name the target file as part of the target path.
    • Remove the --name switch.
    • Ignore dot files in the source image search.
    • Support easier notarization.
  • 1.0.0 18 October 2019
    • Initial public release.

Related Software


The Seal of RassilonThe Seal of Rassilon
Site and software copyright © 2021, Tony Smith
Site Last Updated: 13 May 2021