Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // we create the first slide
- XSLFSlide slide = ppt.createSlide(layout);
- XSLFTextShape title = slide.getPlaceholder(0);
- // we remove the predefined text
- title.clearText();
- // we create a new paragraph
- XSLFTextParagraph p = title.addNewTextParagraph();
- XSLFTextRun r = p.addNewTextRun();
- r.setText("Making Money Online Digest");
- r.setFontColor(Color.decode("#c62828"));
- r.setFontSize(50.);
- // We add an image from resources in the PPTX
- InputStream is = Thread.currentThread().getContextClassLoader().getResourceAsStream("makingmoneyonline_banner_750.png");
- byte[] pd = IOUtils.toByteArray(is);
- XSLFPictureData pictureData = ppt.addPicture(pd, PictureData.PictureType.PNG);
- // we define the position for the data
- XSLFPictureShape pictureShape = slide.createPicture(pictureData);
- pictureShape.setAnchor(new Rectangle(20,180,680,188));
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement