Examples of HSLFSlideShow


Examples of org.apache.poi.hslf.HSLFSlideShow

   *
   */
  public void testBug41015() throws Exception {
    RichTextRun[] rt;

    SlideShow ppt = new SlideShow(new HSLFSlideShow(System.getProperty("HSLF.testdata.path") + "/bug-41015.ppt"));
    Slide sl = ppt.getSlides()[0];
    TextRun[] txt = sl.getTextRuns();
    assertEquals(2, txt.length);

    rt = txt[0].getRichTextRuns();
View Full Code Here

Examples of org.apache.poi.hslf.HSLFSlideShow

    /**
     * Slide 3 has title layout and follows the TitleMaster. Verify that.
     */
    public void testTitleMaster() throws Exception {
        SlideShow ppt = new SlideShow(new HSLFSlideShow(home + "/slide_master.ppt"));
        Slide slide = ppt.getSlides()[2];
        MasterSheet masterSheet = slide.getMasterSheet();
        assertTrue(masterSheet instanceof TitleMaster);

        TextRun[] txt = slide.getTextRuns();
View Full Code Here

Examples of org.apache.poi.hslf.HSLFSlideShow

    }
    /**
     * If a style attribute is not set ensure it is read from the master
     */
    public void testMasterAttributes() throws Exception {
        SlideShow ppt = new SlideShow(new HSLFSlideShow(home + "/slide_master.ppt"));
        Slide[] slide = ppt.getSlides();
        assertEquals(3, slide.length);
        TextRun[] trun;

        trun = slide[0].getTextRuns();
View Full Code Here

Examples of org.apache.poi.hslf.HSLFSlideShow

    /**
     * Check we can dynamically assign a slide master to a slide.
     */
    public void testChangeSlideMaster() throws Exception {
        SlideShow ppt = new SlideShow(new HSLFSlideShow(home + "/slide_master.ppt"));
        SlideMaster[] master = ppt.getSlidesMasters();
        Slide[] slide = ppt.getSlides();
        int sheetNo;

        //each slide uses its own master
        assertEquals(slide[0].getMasterSheet()._getSheetNumber(), master[0]._getSheetNumber());
        assertEquals(slide[1].getMasterSheet()._getSheetNumber(), master[1]._getSheetNumber());

        //all slides use the first master slide
        sheetNo = master[0]._getSheetNumber();
        for (int i = 0; i < slide.length; i++) {
            slide[i].setMasterSheet(master[0]);
        }

        ByteArrayOutputStream out;

        out = new ByteArrayOutputStream();
        ppt.write(out);
        out.close();

        ppt = new SlideShow(new HSLFSlideShow(new ByteArrayInputStream(out.toByteArray())));
        master = ppt.getSlidesMasters();
        slide = ppt.getSlides();
        for (int i = 0; i < slide.length; i++) {
            assertEquals(sheetNo, slide[i].getMasterSheet()._getSheetNumber());
        }
View Full Code Here

Examples of org.apache.poi.hslf.HSLFSlideShow

    /**
     * Varify we can read attrubutes for different identtation levels.
     * (typical for the "bullted body" placeholder)
     */
    public void testIndentation() throws Exception {
        SlideShow ppt = new SlideShow(new HSLFSlideShow(home + "/slide_master.ppt"));
        Slide slide = ppt.getSlides()[0];
        TextRun[] trun;

        trun = slide.getTextRuns();
        for (int i = 0; i < trun.length; i++) {
View Full Code Here

Examples of org.apache.poi.hslf.HSLFSlideShow

    /**
     * Read fill information from an reference ppt file
     */
    public void testReadBackground() throws Exception {
        SlideShow ppt = new SlideShow(new HSLFSlideShow(System.getProperty("HSLF.testdata.path") + "/backgrounds.ppt"));
        Fill fill;
        Shape shape;

        Slide[] slide = ppt.getSlides();

View Full Code Here

Examples of org.apache.poi.hslf.HSLFSlideShow

        //serialize and read again
        ByteArrayOutputStream out = new ByteArrayOutputStream();
        ppt.write(out);
        out.close();

        ppt = new SlideShow(new HSLFSlideShow(new ByteArrayInputStream(out.toByteArray())));
        Slide[] slides = ppt.getSlides();

        fill = slides[0].getBackground().getFill();
        assertEquals(Fill.FILL_PICTURE, fill.getFillType());
        shape = slides[0].getShapes()[0];
View Full Code Here

Examples of org.apache.poi.hslf.HSLFSlideShow

            if(!files[i].getName().endsWith(".ppt")) continue;
            if(files[i].getName().endsWith("PPT95.ppt")) continue;

            try {
                FileInputStream is = new FileInputStream(files[i]);
                HSLFSlideShow hslf = new HSLFSlideShow(is);
                is.close();

                SlideShow ppt = new SlideShow(hslf);
                doSlideShow(ppt);
            } catch (EncryptedPowerPointFileException e){
View Full Code Here

Examples of org.apache.poi.hslf.HSLFSlideShow

    public void setUp() throws Exception {
    String dirname = System.getProperty("HSLF.testdata.path");
    String filename = dirname + "/Single_Coloured_Page_With_Fonts_and_Alignments.ppt";
    FileInputStream fis = new FileInputStream(filename);
    pfs = new POIFSFileSystem(fis);
    hss = new HSLFSlideShow(pfs);
    ss = new SlideShow(hss);
    }
View Full Code Here

Examples of org.apache.poi.hslf.HSLFSlideShow

    private SlideShow ppt;

    protected void setUp() throws Exception {
    String dirname = System.getProperty("HSLF.testdata.path");
    String filename = dirname + "/empty.ppt";
    ppt = new SlideShow(new HSLFSlideShow(filename));
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.