In the spreadsheet app itself, you have the options to print only a specific sheet. You also can turn off the grid lines when creating the pdf from within the app. Is there any way to do this via script when creating the pdf?
Take a look at this code snippet: https://gist.github.com/4169590
What it does is uses Google Spreadsheet built-in download as PDF functionality so the same sort of customization is possible, including hiding gridlines and specifying a worksheet. Play with GET parameters to get the desirable output. In the end, script converts PDF file to a blob which you can manipulate further in your own script. To get this running though you'll need an additional authorization for Spreadsheet feeds scope.
Hope it helps.
@rcknr, worked for me, more options below. (From: http://productforums.google.com/forum/#!msg/apps-script/wQvCF6yY1Qk/R0uyVmf-Xx0J )
URL like this: https://spreadsheets.google.com/feeds/download/spreadsheets/Export?key=tOHm3f8tdIxf7tSZzWvBGiA&gid=0&size=legal&fitw=true&gridlines=false&portrait=false&exportFormat=pdf
other settings
fmcmd=12
size=legal/A4
fzr=true/false
portrait=false/true
fitw=true/false
gid=0/1/2
gridlines=false/true
printtitle=false/true
sheetnames=false/true
pagenum=UNDEFINED
attachment=false/true
true/false where sometimes required, I could not use 0/1 instead.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With