I wanted to do it myself, so Google brought me here. Then I had a mini-brain wave, and I remembered "Microsoft Print to PDF", which is built as an option in the print menu. I tried and it worked!
So just go to File-> Print, then select Microsoft Print to PDF as your printer, then choose a location to save your printout. 
(PS My code is terrible. This file is taken from an old application that I wrote lazily and intend to review)
source share