shapes_comment.rst 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. .. _shapes_comment:
  2. Comments
  3. ========
  4. To create a comment, create an object `Comment`.
  5. Example:
  6. .. code-block:: php
  7. use PhpOffice\PhpPresentation\Shape\Comment;
  8. $oComment = new Comment();
  9. $oSlide->addShape($oComment);
  10. You can define text and date with setters.
  11. Example:
  12. .. code-block:: php
  13. use PhpOffice\PhpPresentation\Shape\Comment;
  14. $oComment = new Comment();
  15. $oComment->setText('Text of the Comment');
  16. $oComment->setDate(time());
  17. $oSlide->addShape($oComment);
  18. Author
  19. ------
  20. For a comment, you can define the author.
  21. Example:
  22. .. code-block:: php
  23. use PhpOffice\PhpPresentation\Shape\Comment;
  24. use PhpOffice\PhpPresentation\Shape\Comment\Author;
  25. $oAuthor = new Author();
  26. $oComment = new Comment();
  27. $oComment->setAuthor($oAuthor);
  28. $oSlide->addShape($oComment);
  29. You can define name and initials with setters.
  30. Example:
  31. .. code-block:: php
  32. use PhpOffice\PhpPresentation\Shape\Comment;
  33. use PhpOffice\PhpPresentation\Shape\Comment\Author;
  34. $oAuthor = new Author();
  35. $oAuthor->setName('Name of the author');
  36. $oAuthor->setInitals('Nota');
  37. $oComment = new Comment();
  38. $oComment->setAuthor($oAuthor);
  39. $oSlide->addShape($oComment);