img2pdf 1.01 by Arnab Bose (C) 2011.
Commandline utility to (i) merge pdfs (ii) split pdfs and (iii) print images onto pdfs.
Usage:
img2pdf [options] <content> [<content>]...
content: <imagefile>|[<pages>:]<pdffile.pdf>
Can be an image, or a pdf file. Can contain wildcards.
For a pdf file, it can be optionally preceeded by "<pages>::".
For example, 2-4,6::file.pdf will only extract corresponding four pages.
options: Options can be any of below, and can be repeated.
-dpi<dpi> - To override detected dpi of the image. Default is 0.
-margin<margin> - Change the page margin in pixels. Default is 36.
-center[-] - Enable [disable] centering. Default is enabled.
-shrink[-] - Enable [disable] automatic shrinking for large images. Default is disabled.
-resize[-] - Enable [disable] resizing to fit image to page. Default is disabled.
-duplex[-] - Enable [disable] aligning for duplex print. Default is disabled.
-odd - Ensures next file starts at an odd page number. Unnecessary if -duplex is enabled.
-out<filename> - Change output file name. Default is _output.pdf.
Example:
img2pdf -center- sunset.jpg ocean.jpg -outholiday.pdf
The above disables centering, stores two jpeg files into holiday.pdf.
I needed a commandline Windows utility to merge pdfs and print image files onto pdf files. There were some in the web, but none seemed to have all the features I wanted. So I put together one for me.
Features in this that are not apparently present in online implementations -
Known issues: May not work on PDFs composed with Acrobat 6 as input.
The result is one nice little tool very useful to me - hope you find it helpful too!
Acknowledgement: PDF Sharp Library for C#