问题
(Sorry for my english)
I have a problem when using Google Slides API. How can I choose a theme when create new presentation with Google Slides API?
Thanks.
1. create a presentation
function createPresentation($title) {
$presentation = new Google_Service_Slides_Presentation(array(
'title' => $title
));
$presentation = $this->slidesService->presentations->create($presentation);
$presentationLastId = $presentation->presentationId;
return $presentationLastId;
}
2. append a slide
protected function createSlideRequest($presentationId, $slideId, $data = array())
{
$requests = array();
$requests[] = new Google_Service_Slides_Request(array(
'createSlide' => array (
'objectId' => $slideId,
'slideLayoutReference' => array ('predefinedLayout' => 'BLANK')
),
));
$batchUpdateRequest = new Google_Service_Slides_BatchUpdatePresentationRequest(array(
'requests' => $requests
));
$response = $this->slidesService->presentations->batchUpdate($presentationId, $batchUpdateRequest);
return $response;
}
The result like image below after call two requests:
But i want create a presentation like:
来源:https://stackoverflow.com/questions/52870270/google-slides-api-how-way-change-theme-via-api