Skip to main content
Skip table of contents

addParagraph

Versionshinweise

22.1, 21.2.06. 21.1.11

Code

GROOVY
boolean addParagraph(PresentationDocument document, String text, String identifier, int pageIndex, int depth)

Beschreibung

Ein Text wird als neuer Absatz am Ende der referenzierten Textkomponente angehängt.

Parameter

  • document

    Repräsentiert die Präsentationsdatei
  • text
    Textinhalt des einzufügenden Absatzes
  • identifier
    Name der Textkomponente
  • pageIndex
    Index der Seite, auf der sich die Textkomponente befindet. (erste Seite startet mit 1)
  • depth
    Optionaler Parameter zur Konfiguration der Listenebene, z.B. 1 oder 2 oder 3
    Voraussetzung: Der Absatz wird in einer Liste eingefügt

Rückgabe

Liefert true, wenn das Anhängen eines Absatzes in der referenzierten Textkomponente erfolgreich war, ansonsten false.

Beispiele

GROOVY
IPresentationResult openResult = PresentationUtils.openFile("C:\\Work\\myFirstPresentation.ppsx");

if (!PresentationUtils.isSuccessful(openResult))
{
	/** handle error code */
    return;
}

PresentationDocument presentation = null;
try
{
  presentation = PresentationUtils.getPresentationDocument(openResult);

  String identifier = "myList";
  int pageIndex = 1;

  if (PresentationUtils.existsComponent(presentation, identifier, pageIndex))
  {
	   /** add paragraph in a list at last position - level of list entry is 2 */
       boolean success = PresentationUtils.addParagraph(presentation, "here is a new paragraph", identifier, pageIndex, 2);
       ...
  }
}
finally
{
  PresentationUtils.close(presentation);
}
JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.