Save workbook to PDF

Refer to the following example code to export a workbook to PDF document.