/sigmah/src/test/java/org/sigmah/server/report/renderer/ppt/PptAlphaCheck.java
Java | 42 lines | 22 code | 13 blank | 7 comment | 1 complexity | b50cd5d333ad06f0d4045ee1d1f67cf3 MD5 | raw file
1/* 2 * All Sigmah code is released under the GNU General Public License v3 3 * See COPYRIGHT.txt and LICENSE.txt. 4 */ 5 6package org.sigmah.server.report.renderer.ppt; 7 8import org.apache.poi.ddf.EscherProperties; 9import org.apache.poi.hslf.HSLFSlideShow; 10import org.apache.poi.hslf.model.Shape; 11import org.apache.poi.hslf.model.Slide; 12import org.apache.poi.hslf.usermodel.SlideShow; 13import org.junit.Test; 14 15import java.io.IOException; 16import java.io.InputStream; 17/* 18 * @author Alex Bertram 19 */ 20 21public class PptAlphaCheck { 22 23 24 @Test 25 public void testAlphaValues() throws IOException { 26 27 28 InputStream in = PptAlphaCheck.class.getResourceAsStream("/alpha.ppt"); 29 SlideShow ppt = new SlideShow( new HSLFSlideShow(in) ); 30 31 Slide[] slides = ppt.getSlides(); 32 Shape[] shapes = slides[0].getShapes(); 33 34 for(int i=0; i!=shapes.length; ++i) { 35 System.out.println(String.format("slide %d, opacity = %d", i, 36 shapes[i].getEscherProperty(EscherProperties.FILL__FILLOPACITY))); 37 38 39 } 40 41 } 42}