Reputation: 215
I try to custom my page size and margin but it doesn't working. I had try to used the auto API in the site but the result still not change the margin. Is there any change in the google docs api?
Upvotes: 2
Views: 567
Reputation: 201553
Unfortunately, in the current stage, it seems that documentStyle
and content
cannot be set with the method of documents.create. Ref I confirmed that this has still not been modified. So as the current workaround, how about the following flow?
Create new Document using the method of documents.create
. In this case, the title can be set.
Set updateDocumentStyle
using the method of documents.batchUpdate
.
From your question, the request body for documents.batchUpdate is as follows.
{
"requests": [
{
"updateDocumentStyle": {
"documentStyle": {
"marginTop": {
"magnitude": 100,
"unit": "PT"
},
"marginLeft": {
"magnitude": 500,
"unit": "PT"
}
},
"fields": "marginTop,marginLeft"
}
}
]
}
If this was not the direction you want, I apologize.
Upvotes: 3