Hi,
Attached Comment.ppt file have a comment. Can you help me please, do you have support for comments and how I can get text from it?
Thanks,
Bojan
Hi,
Hi Bojan,
public static void AddPPTSlideComments() throws Exception{String path = “C:\Users\Mudassir\Downloads\”;Presentation pres = new Presentation();//Getting first slideSlide slide = pres.getSlides().get(0);//Adding AutthorCommentAuthor author = pres.getCommentAuthors().addAuthor(“Mudassir”);//Position of commentsjava.awt.Point point = new java.awt.Point(100,100);java.util.Date date = new java.util.Date();//Adding Slide commentsslide.getSlideComments().addComment(author, “MF”, “Hello Mudassir, this is slide comment”, date, point);//Adding Empty slideslide = pres.addEmptySlide();//Position of commentsjava.awt.Point point2 = new java.awt.Point(500,1400);//Adding Slide commentsslide.getSlideComments().addComment(author,“MF”,“Hello Mudassir, this is second slide comment”, date,point2);Comments comments = slide.getSlideComments();//Accessin the comment at index 0 for slide 1String str = comments.get(0).getText();pres.write(path + “Comments.ppt”);}public static void IdentifyPptComments() throws Exception{String path = “C:\Users\Mudassir\Downloads\”;Presentation pres = new Presentation(path + “Comments.ppt”);java.text.DateFormat dateFormat = new java.text.SimpleDateFormat(“yyyy/MM/dd HH:mm:ss”);int i = 1;for (Slide slide : pres.getSlides()){Comments comments=slide.getSlideComments();for (int j=0;j<comments.size();j++ ){Comment comment = comments.get(j);System.out.println(“Slide :” + Integer.toString(i)+ " has comment: " + comment.getText() + " with Author: " + comment.getAuthor().getName() + " posted on time :" + dateFormat.format(comment.getCreatedTime()) + “\n”);i++;}}}