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?
1 Answer
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?
Flow:
Create new Document using the method of
documents.create. In this case, the title can be set.Set
updateDocumentStyleusing the method ofdocuments.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" } } ] }
References:
If this was not the direction you want, I apologize.
