To use this script in Google Drive:
- In your spreadsheet, click Tools->Script Editor.
- Paste the contents of Code.gs into the editor.
- Save.
- Select "Allow" when Google asks about permissions.
- Reload your spreadsheet.
You should now see a new file menu option, "Export".
If you add the code below at line 50 (after replacing cell values with text) then it will also remove all the notes on the temporary spreadsheet (otherwise the notes will show up on a separate page of the pdf)