Here is a version with microsoft word:
Here is a shell script:
Here is a version with Calibre
Personal I like the method with calibre the most because you can very easily pass conditions for pagesize, pagenumbers etc to the pdf-version.