Comment / CommentAuthor — Aspose.Slides FOSS for Java API Reference

Enumerations Comment и CommentAuthor класовете представляват коментари към слайдове и техните автори. Те реализират IComment и ICommentAuthor съответно.

Enumerations: org.aspose.slides.foss

import org.aspose.slides.foss.*;

Enumerations

public class Comment implements IComment

Enumerations

EnumerationsEnumerations
Comment(String text, ICommentAuthor author, ISlide slide, PointF position, LocalDateTime createdTime)Създайте нов коментар.

Enumerations

EnumerationsEnumerationsEnumerationsEnumerations
getText() / setText(String)StringЧетене/ЗаписТекст на коментара.
getAuthor()ICommentAuthorEnumerationsАвторът на коментара.
getSlide()ISlideEnumerationsСлайдът, на който е този коментар.
getPosition()PointFEnumerationsПозиция върху слайда.
getCreatedTime()LocalDateTimeEnumerationsВремева отметка за създаване.
getParentComment()Optional<IComment>EnumerationsРодителски коментар за отговори.
setParentComment(IComment)voidEnumerationsЗадаване на родителски коментар.

Enumerations

EnumerationsEnumerationsEnumerations
remove()voidПремахване на този коментар.

CommentAuthor

public class CommentAuthor implements ICommentAuthor

Enumerations

EnumerationsEnumerations
CommentAuthor(String name, String initials, int id)Създаване на нов автор на коментар.

Enumerations

EnumerationsEnumerationsEnumerations
getName()StringИме на автора.
getInitials()StringИнициали на автора.
getId()intИдентификатор на автора.
getComments()ICommentCollectionКоментари от този автор.

Примери за употреба

Добавяне на коментар към слайд

import org.aspose.slides.foss.*;
import java.time.LocalDateTime;

Presentation prs = new Presentation();
ICommentAuthorCollection authors = prs.getCommentAuthors();
ICommentAuthor author = authors.addAuthor("John", "J");

ISlide slide = prs.getSlides().get(0);
slide.getSlideComments(null); // read existing comments

// Add comment via the author's comment collection
author.getComments().addComment(
    "Review this slide", slide, new PointF(100, 100), LocalDateTime.now());

prs.save("commented.pptx", SaveFormat.PPTX);

Вижте също

 Български