I can effectively export to PDF from a google sheet using this code
from pydrive.auth import GoogleAuth
from pydrive.drive import GoogleDrive
gDriveCreds="mycreds.txt"
gauth = GoogleAuth()
GoogleAuth.DEFAULT_SETTINGS['client_config_file'] = "client_secrets.json"
gauth.LoadCredentialsFile(gDriveCreds)
if gauth.credentials is None:
gauth.LocalWebserverAuth()
elif gauth.access_token_expired:
gauth.Refresh()
else:
gauth.Authorize()
gauth.SaveCredentialsFile(gDriveCreds)
drive = GoogleDrive(gauth)
file_obj = drive.CreateFile({'id': 'sfkldjlfsdkjfgdklj'})
file_obj.GetContentFile('temp.pdf', mimetype='application/pdf')
But I can't figure out a way to create the pdf with 0" margins like I want. I have the google sheet set up with 0" margins, but the python export just defaults to some typical margin.