0

I'm writing Google Apps script to export a G sheet to pdf, using this article as a basis.

In the list of options that get sent to the spreadsheet export service is "printtitle=true". If I use this then I get the spreadsheet name at the top of each page.

I would like to change that name, on the exported pdf, so that it includes the date, for example. I'm looking for some documentation on this but can't find it! Help would be appreciated.

keble
  • 93
  • 1
  • 11
  • Does this answer your question? [Generate PDF of only one sheet of my spreadsheet](https://stackoverflow.com/questions/49197358/generate-pdf-of-only-one-sheet-of-my-spreadsheet) – Kos Jan 31 '20 at 11:48
  • You cannot change that option. What you could try is to change the name before exporting and then change it back. Will this work for you? – Raserhin Jan 31 '20 at 12:01
  • I have managed this before (but code now lost!). I wonder if I can specify a header field? – keble Jan 31 '20 at 12:14

1 Answers1

1

This is a workaround: in this post, the author found that you can use &sheetnames=true which will print the sheet name on the page. So you could change the sheet name "on the fly" to get a kind of customised header.

keble
  • 93
  • 1
  • 11