Questions tagged [xslf]

Apache POI - XSLF - Java API to Handle Microsoft Powerpoint pptx Files

XSLF is the Apache POI Project's pure Java implementation of the PowerPoint 2007 OOXML (.xlsx) file format. Whilst HSLF and XSLF provide similar features, there is not a common interface across the two of them at this time.

Please note that XSLF is still reworked in recent releases of Apache POI and is still subject to some incompatible changes. Make sure to use the latest version of POI.

A quick guide is available in the XSLF Cookbook

36 questions
8
votes
2 answers

Setting pptx Theme in Java

I am trying to merge some pptx documents programmatically using java. I figured out how to do this in essence using Apache POI but the documents I am trying to merge do not work. After significant searching and trial and error I figured out that the…
ThinkBonobo
  • 15,487
  • 9
  • 65
  • 80
7
votes
1 answer

IllegalStateException when trying to setFillColor using Apache POI XSLF

I'm trying to set the background fill color for a pptx file using the Apache POI XSLF library. My code looks like this: XSLFSlideMaster defaultMaster = ppt.getSlideMasters().get(0); XSLFSlideLayout layout =…
Kaptain
  • 115
  • 1
  • 2
  • 7
5
votes
3 answers

How to get pptx slide notes text using apache poi?

So far I only have a working code for retrieving texts from ppt slide notes try { FileInputStream is = new FileInputStream("C:\\sample\\test.ppt"); SlideShow ppt = new SlideShow(is); Slide[] slide = ppt.getSlides(); for (int i = 0;…
Gerard Cruz
  • 641
  • 14
  • 34
4
votes
1 answer

How to create PPTX when using POI XSLF?

When I create a PPTX with POI XSLF I get a blank slide: XMLSlideShow ppt = new XMLSlideShow(); XSLFSlide slide = ppt.createSlide(); XSLFTextBox shape = slide.createTextBox(); XSLFTextParagraph p = shape.addNewTextParagraph(); XSLFTextRun r1 =…
jlh
  • 61
  • 3
4
votes
2 answers

How to get "last saved by" Office file attribute in Java

I am trying to get the "last saved by" attribute from MS Office 2013 file(docx, xlsx, pptx ...). I am using Apache POI, but I can get only the Author of the file with the following code: OPCPackage pkg = OPCPackage.open(file); POIXMLProperties props…
Ivaylo
  • 43
  • 4
3
votes
1 answer

Apache POI Powerpoint Alternative

I have an application which currently uses the Apache POI libraries to produce Microsoft Powerpoint documents. I need to move this application into a more restricted environment which doesn't allow the POI libraries. Are there any alternatives to…
deterb
  • 3,994
  • 1
  • 28
  • 33
3
votes
1 answer

read .pptx causes java.lang.ClassNotFoundException

In this question someone had a similar problem I have: I want to read the content of a .pptx file (only the text), but only got it work with .ppt files. So I tried to solve it with the accepted answer, but I got this exception:…
Munchkin
  • 4,528
  • 7
  • 45
  • 93
3
votes
1 answer

How do I get background data from pptx slides using apache poi

I am trying to build a rather crude tool that converts a ppt/pptx file to a HTML format. I have found out that, unfortunately, apache poi does not provide a unified programming model for working with power point files and code has to be written for…
2
votes
2 answers

Extracting images from pptx with apache poi

I'm trying to extract slides from a ppt file with Apache POI, there is no problem in that, but now I intend to open pptx files and do the same, does anyone knows how to?? this is the code to extract images from ppt files: public ImageIcon display()…
jGoC
  • 21
  • 1
  • 3
2
votes
1 answer

How to get image size using getImageDimensionInPixels() from java.awt.Dimension in poi ppt?

I iterate over all pictures in ppt using following, for(XSLFPictureData data : ppt.getAllPictures()){ byte[] bytes = data.getData(); String fileName = data.getFileName(); int pictureFormat = data.getPictureType(); …
Dave D.
  • 737
  • 3
  • 10
  • 23
2
votes
0 answers

How to refresh embedded content in a pptx using Apache POI?

Dear all, I'm working with Apache POI and I'm trying to automate some tasks with Powerpoint reports. More precisely, I would like to update the data inside a .pptx presentation from code, including embedded Excel spreadsheets (displayed as…
2
votes
1 answer

Modifying a PowerPoint table using POI-3.10-FINAL

I've been having issues using POI-3.10-FINAL where editing a PPTX doesn't fully work. I noticed that I am successfully able to add new slides, but modifications to shapes (in this case, a table) aren't reflected in the outputted PPTX file. I was…
Kouame
  • 41
  • 4
1
vote
1 answer

Resizing a XSLFChart

When creating a XSLFChart on a XSLFSlide, I can't seem to get the anchoring to work as intended. I'm generate the chart as follows XSLFSlide slide = ppt.createSlide(); XSLFChart chart = ppt.createChart(slide); slide.addChart(chart, new…
1
vote
0 answers

Problem create chart from scratch with Apache Poi

When I create a chart from scratch and add it to a slide within a PowerPoint using Apache Poi the corresponding XSLFGraphicFrame shape get created and added to the XML but it doesn't get added to the getShapes() list within the slide, things that…
1
vote
1 answer

Correct Text Alignment when there is a bullet point using apache poi

I am using apache poi xslf to create a text box and then adding a bullet point in it. Issue is that When bullet point is multi line text, it adds like this -Text analysis, nGram, Naïve Bayes Text Classifier to identify the nature of the…
user3768904
  • 261
  • 3
  • 15
1
2 3