Write a program that can create a PDF document that contains images from a user-specified directory. The images must be displayed one after another. If an image does not fit on the remainder of a page, it must be placed on the next page.
The following is an example of such a PDF file, created from several images of Albert Einstein (these pictures are featured along with the source code accompanying the book):