Make PDF Book

From TheAlmightyGuru
Jump to: navigation, search

Make PDF Book is a JScript program that converts all of the JPG images in the folder of the script into a single PDF document using Imagemagick. This script requires that Imagemagick be installed and able to be accessed as an object.


// This script uses Imagemagick to convert all the JPEG images in the current folder into a single 
// PDF document based on the alphabetical order of the files.
// The Extent parameter should be altered to match the widest width and tallest height of all the images.
// © Copyright: Dean Tersigni, 2017-08-28.

var oIM = new ActiveXObject("ImageMagickObject.MagickImage.1");
oIM.convert("*.jpg", "-gravity", "center", "-extent", "638x900", "-density", "72", "book.pdf");