just to keep this a bit relevent to web development:
simplest way to do that is using 'convert' from ImageMagik.
shell:
Code:
convert input.jpg output.pdf
php:
Code:
shell_exec('convert input.jpg output.pdf')
or using api if you can't execute shell commands
(manual:
http://php.net/manual/en/book.imagick.php)