Advertisement
Guest User

Untitled

a guest
Mar 19th, 2019
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.81 KB | None | 0 0
  1. // we create the first slide
  2. XSLFSlide slide = ppt.createSlide(layout);
  3. XSLFTextShape title = slide.getPlaceholder(0);
  4. // we remove the predefined text
  5. title.clearText();
  6.  
  7. // we create a new paragraph
  8. XSLFTextParagraph p = title.addNewTextParagraph();
  9. XSLFTextRun r = p.addNewTextRun();
  10. r.setText("Making Money Online Digest");
  11. r.setFontColor(Color.decode("#c62828"));
  12. r.setFontSize(50.);
  13.  
  14. // We add an image from resources in the PPTX
  15. InputStream is = Thread.currentThread().getContextClassLoader().getResourceAsStream("makingmoneyonline_banner_750.png");
  16. byte[] pd = IOUtils.toByteArray(is);
  17.  
  18. XSLFPictureData pictureData = ppt.addPicture(pd, PictureData.PictureType.PNG);
  19. // we define the position for the data
  20. XSLFPictureShape pictureShape = slide.createPicture(pictureData);
  21. pictureShape.setAnchor(new Rectangle(20,180,680,188));
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement