In a previous post I mentioned that when we (Critical Path Training) make changes to a course we have to update a lot of PowerPoint presentations. We then print these out as PDF’s to generate our course manual. This can be a tedious process. The previous post discussed how I was able to use the Open XML SDK 2.0 to automate the process of updating the headers and footers in each slide in each presentation, reducing a task that would typically take an hour or more down to about 15 seconds.
The next step is to generate PDF files from the presentation. This too is a tedious task… one that’s just a pain. After digging around in the TechNet Windows PowerShell forums, I was able to figure out how to automate this process with Windows PowerShell!
The following script looks at all *.PPTX files in a folder, and for each one it opens it up, sets the printer to use (in this case I prefer to use the Adobe PDF Writer that you get with Acrobat) set a few properties and then tell PowerPoint to print the file.
In the script, the OutputType property signifies what print mode you want. I generally use two values:
- OutputType = 2: Prints out two slides per page without the presenter’s notes.
- OutputType = 5: Prints out one slide with the presenter notes at the bottom.