Google Slides
    
    
      
    
    
      
      Zadbaj o dobrą organizację dzięki kolekcji
    
    
      
      Zapisuj i kategoryzuj treści zgodnie ze swoimi preferencjami.
    
  
    
  
      
    
  
  
  
  
  
    
    
    
  
  
    
    
    
Utwórz nową prezentację
function createPresentation() {
  var presentation =
      Slides.Presentations.create({"title": "MyNewPresentation"});
  console.log("Created presentation with ID: " + presentation.presentationId);
}
Utwórz nowy slajd
function createSlide(presentationId) {
  // You can specify the ID to use for the slide, as long as it's unique.
  var pageId = Utilities.getUuid();
  var requests = [{
    "createSlide": {
      "objectId": pageId,
      "insertionIndex": 1,
      "slideLayoutReference": {
        "predefinedLayout": "TITLE_AND_TWO_COLUMNS"
      }
    }
  }];
  var slide =
      Slides.Presentations.batchUpdate({'requests': requests}, presentationId);
  console.log("Created Slide with ID: " + slide.replies[0].createSlide.objectId);
}
Przeczytaj identyfikatory obiektów elementów strony
function readPageElementIds(presentationId, pageId) {
  // You can use a field mask to limit the data the API retrieves
  // in a get request, or what fields are updated in an batchUpdate.
  var response = Slides.Presentations.Pages.get(
      presentationId, pageId, {"fields": "pageElements.objectId"});
  console.log(response);
}
Dodaj nowe pole tekstowe
function addTextBox(presentationId, pageId) {
  // You can specify the ID to use for elements you create,
  // as long as the ID is unique.
  var pageElementId = Utilities.getUuid();
  var requests = [{
    "createShape": {
      "objectId": pageElementId,
      "shapeType": "TEXT_BOX",
      "elementProperties": {
        "pageObjectId": pageId,
        "size": {
          "width": {
            "magnitude": 150,
            "unit": "PT"
          },
          "height": {
            "magnitude": 50,
            "unit": "PT"
          }
        },
        "transform": {
          "scaleX": 1,
          "scaleY": 1,
          "translateX": 200,
          "translateY": 100,
          "unit": "PT"
        }
      }
    }
  }, {
    "insertText": {
      "objectId": pageElementId,
      "text": "My Added Text Box",
      "insertionIndex": 0
    }
  }];
  var response =
      Slides.Presentations.batchUpdate({'requests': requests}, presentationId);
  console.log("Created Textbox with ID: " +
      response.replies[0].createShape.objectId);
}
Sformatuj tekst kształtu
function formatShapeText(presentationId, shapeId) {
  var requests = [{
    "updateTextStyle": {
      "objectId": shapeId,
      "fields": "foregroundColor,bold,italic,fontFamily,fontSize,underline",
      "style": {
        "foregroundColor": {
          "opaqueColor": {
            "themeColor": "ACCENT5"
          }
        },
        "bold": true,
        "italic": true,
        "underline": true,
        "fontFamily": "Corsiva",
        "fontSize": {
          "magnitude": 18,
          "unit": "PT"
        }
      },
      "textRange": {
        "type": "ALL"
      }
    }
  }];
  var response =
      Slides.Presentations.batchUpdate({'requests': requests}, presentationId);
}
  
  
  
  
    
  
 
  
    
      
      
    
    
      
    
    
  
       
    
    
      
    
  
  
  O ile nie stwierdzono inaczej, treść tej strony jest objęta licencją Creative Commons – uznanie autorstwa 4.0, a fragmenty kodu są dostępne na licencji Apache 2.0. Szczegółowe informacje na ten temat zawierają zasady dotyczące witryny Google Developers. Java jest zastrzeżonym znakiem towarowym firmy Oracle i jej podmiotów stowarzyszonych.
  Ostatnia aktualizacja: 2025-08-21 UTC.
  
  
  
    
      [[["Łatwo zrozumieć","easyToUnderstand","thumb-up"],["Rozwiązało to mój problem","solvedMyProblem","thumb-up"],["Inne","otherUp","thumb-up"]],[["Brak potrzebnych mi informacji","missingTheInformationINeed","thumb-down"],["Zbyt skomplikowane / zbyt wiele czynności do wykonania","tooComplicatedTooManySteps","thumb-down"],["Nieaktualne treści","outOfDate","thumb-down"],["Problem z tłumaczeniem","translationIssue","thumb-down"],["Problem z przykładami/kodem","samplesCodeIssue","thumb-down"],["Inne","otherDown","thumb-down"]],["Ostatnia aktualizacja: 2025-08-21 UTC."],[],[]]