(对不起,我的英语)
使用Google Slides API时出现问题。使用Google Slides API创建新演示文稿时如何选择主题?
谢谢。
1。。创建演示文稿
function createPresentation($title) {
$presentation = new Google_Service_Slides_Presentation(array(
'title' => $title
));
$presentation = $this->slidesService->presentations->create($presentation);
$presentationLastId = $presentation->presentationId;
return $presentationLastId;
}
2。。附加一张幻灯片
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;
}