Robert Watcher
Well-known member
I THINK THAT THIS BIT OF INFO MAY BE PARTICULARLY UEFUL TO PHOTOGRAPHERS.
So I have just finished the first Travel Book based on our (Anne and I) experiences living for extended periods of time in countries such as Costa Rica and Nicaragua. When all was said and done yesterday, I decided that I would do a screen capture of every one of the pages spreads and combine them into a pdf in order to have a digital copy of the project.
In times past I have been able to do this using Photoshop, and so was surprised to find that in my current version of CS4 - both the create pdf as well as the create contact sheet - have been removed. And so after all of the work of pasting 40 layers (one for each double page spread) into a new document, I at least wanted to save each one so that I didn't have to start all over again when I find out how to create the PDF in the future.
That is fair bit of work to do manually, and so a Google search helped me out by showing me how to use a premade script that already exists in Photoshop - to automate the process. It is File > Scripts > Export Layers to File. I first saved the set as PSD and then after I did some more digging and realized that there was no way that would be able to get Photoshop to create the PDF, went back in and ran the script again - this time svaing to JPEG.
Now back to the task at hand. I came across an online post about using the Command Line in ImageMagick. This is an application that is included with many web hosting accounts and so I have worked with it using the PHP language that I am familiar with. But I am not a Command Prompt user and get lost in that archaic lingo. But I have in fact done some previously when working with video using the ffmpeg application - - - and I realized the power these programs have to accomplish any task one wants.
I wasn't aware that Imagemagick could be downloaded and run from the computer. So I went to the provided url (http://www.imagemagick.org/script/index.php) and installed it on my desktop. Then it was a matter of figuring out how to write the code that would get me to the directory where the saved jpg files of the book page spreads, were stored. After an hour I was traversing through my computer folders like I was a pro.
Fortunately, the thread I found provided the exact code that I needed to transfer all of the jpg files into one pdf file. It is actually quite simple once I got my head around it - and it works as effortlessly and flawlessly as did the time that I used ffmpeg to extract individual video frames, reorder them, or turn a set of jpegs into an animated video. While other programs (most of which use these libraries to accomplish their task) may be able to accomplish some of the processing tasks required - if a bit of time is spent learning how to write the command lines necessary to do almost any task imaginable - - - it is very satisfying and you feel that you have a power beyond what any commerical program can provide.
Of course I can never remember these lines of code - and there is no need for anyone to. That is why I am writing it down in this thread, so that I can call on it when in the future I desire to creat another PDF file from a set of JPG files. Actually I think that it is something I will do more often now that I am able to:
To create a multi-page PDF file from all JPEG files in the current directory run :
To convert file1.jpg file2.jpg file3.jpg to file.pdf run
---------
To use ImageMagick after you have downloaded and installed it. With a PC : in your Windows DropDown, go to All Programs > Accessories > Command Prompt. A black box will open with a DOS style prompt. If it starts at your C: drive, you need to change the directory to where the files are stored. In my case, they were stored on my Desktop in a folder named "temp". I got there by typing after the C:\> that displays
"cd" stands for change directory. To work back out of the directories one at a time, use "cd.."
The prompt then displayed:
putting me the directory where my book page files could be accessed and converted. right after that prompt, I simply typed in the "convert" code that is provided above.
All together the code I typed in looked like this (cannot copy and paste the code in)
VOILA - I checked back into the temp folder and there was a brand new PDF file sitting there - perfectly formed with all of my 40 pages ready to open in Adobe Acrobat Reader.
So I have just finished the first Travel Book based on our (Anne and I) experiences living for extended periods of time in countries such as Costa Rica and Nicaragua. When all was said and done yesterday, I decided that I would do a screen capture of every one of the pages spreads and combine them into a pdf in order to have a digital copy of the project.
In times past I have been able to do this using Photoshop, and so was surprised to find that in my current version of CS4 - both the create pdf as well as the create contact sheet - have been removed. And so after all of the work of pasting 40 layers (one for each double page spread) into a new document, I at least wanted to save each one so that I didn't have to start all over again when I find out how to create the PDF in the future.
That is fair bit of work to do manually, and so a Google search helped me out by showing me how to use a premade script that already exists in Photoshop - to automate the process. It is File > Scripts > Export Layers to File. I first saved the set as PSD and then after I did some more digging and realized that there was no way that would be able to get Photoshop to create the PDF, went back in and ran the script again - this time svaing to JPEG.
Now back to the task at hand. I came across an online post about using the Command Line in ImageMagick. This is an application that is included with many web hosting accounts and so I have worked with it using the PHP language that I am familiar with. But I am not a Command Prompt user and get lost in that archaic lingo. But I have in fact done some previously when working with video using the ffmpeg application - - - and I realized the power these programs have to accomplish any task one wants.
I wasn't aware that Imagemagick could be downloaded and run from the computer. So I went to the provided url (http://www.imagemagick.org/script/index.php) and installed it on my desktop. Then it was a matter of figuring out how to write the code that would get me to the directory where the saved jpg files of the book page spreads, were stored. After an hour I was traversing through my computer folders like I was a pro.
Fortunately, the thread I found provided the exact code that I needed to transfer all of the jpg files into one pdf file. It is actually quite simple once I got my head around it - and it works as effortlessly and flawlessly as did the time that I used ffmpeg to extract individual video frames, reorder them, or turn a set of jpegs into an animated video. While other programs (most of which use these libraries to accomplish their task) may be able to accomplish some of the processing tasks required - if a bit of time is spent learning how to write the command lines necessary to do almost any task imaginable - - - it is very satisfying and you feel that you have a power beyond what any commerical program can provide.
Of course I can never remember these lines of code - and there is no need for anyone to. That is why I am writing it down in this thread, so that I can call on it when in the future I desire to creat another PDF file from a set of JPG files. Actually I think that it is something I will do more often now that I am able to:
To create a multi-page PDF file from all JPEG files in the current directory run :
Code:
convert *.jpg file.pdf
To convert file1.jpg file2.jpg file3.jpg to file.pdf run
Code:
convert file1.jpg file2.jpg file3.jpg file.pdf
---------
To use ImageMagick after you have downloaded and installed it. With a PC : in your Windows DropDown, go to All Programs > Accessories > Command Prompt. A black box will open with a DOS style prompt. If it starts at your C: drive, you need to change the directory to where the files are stored. In my case, they were stored on my Desktop in a folder named "temp". I got there by typing after the C:\> that displays
Code:
C:\>cd Users\Rob\Desktop\temp
"cd" stands for change directory. To work back out of the directories one at a time, use "cd.."
The prompt then displayed:
Code:
C:\Users\Rob\Desktop\temp>
All together the code I typed in looked like this (cannot copy and paste the code in)
Code:
C:\Users\Rob\Desktop\temp>convert *.jpg file.pdf
VOILA - I checked back into the temp folder and there was a brand new PDF file sitting there - perfectly formed with all of my 40 pages ready to open in Adobe Acrobat Reader.