The setRowHeight function does not work in 3.7beta2, nor 3.7beta3. Sample code (height variable has no effect): int height = 135; SlideShow ppt = new SlideShow(); Slide slide = ppt.createSlide(); Table table = new Table(4, 4); int width = 50; TableCell cell = null; for (int i = 0; i < table.getNumberOfRows(); i++) { for (int j = 0; j < table.getNumberOfColumns(); j++) { cell = table.getCell(i, j); RichTextRun r = cell.getTextRun().getRichTextRuns()[0]; r.setText("helloworld"); r.setFontName("Arial"); r.setFontSize(10); r.setTextOffset(0); } } table.setAllBorders(new Line()); slide.addShape(table); //set table dimensions for (int i = 0; i < table.getNumberOfRows(); i++) table.setRowHeight(i, height); for (int i = 0; i < table.getNumberOfColumns(); i++) table.setColumnWidth(i, width); table.moveTo(50,50); //save changes in a file try { FileOutputStream out = new FileOutputStream("test.ppt"); ppt.write(out); out.close(); } catch (IOException ex) { System.out.println("Trouble writing or closing out file!\n"); }
After changing the row height, does POI see the change? If you then save to a file, and re-read with POI, is the height change seen then?
This has been fixed ... I haven't checked when. This was my test code: @Test public void testRowHeight() throws IOException { HSLFSlideShow ppt = new HSLFSlideShow(); HSLFSlide slide = ppt.createSlide(); HSLFTable tab = slide.createTable(4, 4); for (int row=0; row<4; row++) { for (int col=0; col<4; col++) { HSLFTableCell c = tab.getCell(row, col); HSLFTextRun tr = c.getTextParagraphs().get(0).getTextRuns().get(0); tr.setText("hello"); tr.setFontFamily("Arial"); tr.setFontSize(10.); } } new DrawTableShape(tab).setAllBorders(1., Color.black, StrokeStyle.LineDash.SOLID); tab.setRowHeight(2, 80); tab.moveTo(100, 100); FileOutputStream fos = new FileOutputStream("bla.ppt"); ppt.write(fos); fos.close(); ppt.close(); }