Google Slides API-如何通过API更改主题

时间:2018-10-18 08:47:19

标签: google-slides-api

(对不起,我的英语)

使用Google Slides API时出现问题。使用Google Slides API创建新演示文稿时如何选择主题?

谢谢。

enter image description here


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;
    }
  • 两次调用后的结果如下图enter image description here

  • 但是我想创建一个演示文稿enter image description here

0 个答案:

没有答案