Examples of HSLFSlideShow


Examples of org.apache.poi.hslf.HSLFSlideShow

    r.writeOut(baos);
    return baos.toByteArray();
  }

    public void testIndentationLevel() throws Exception {
        SlideShow ppt = new SlideShow(new HSLFSlideShow(new File(System.getProperty("HSLF.testdata.path"), "ParagraphStylesShorterThanCharStyles.ppt").getPath()));
        Slide[] sl = ppt.getSlides();
        for (int i = 0; i < sl.length; i++) {
            TextRun[] txt = sl[i].getTextRuns();
            for (int j = 0; j < txt.length; j++) {
                RichTextRun[] rt = txt[j].getRichTextRuns();
View Full Code Here

Examples of org.apache.poi.hslf.HSLFSlideShow

    protected void setUp() throws Exception {
    String dirname = System.getProperty("HSLF.testdata.path");
   
    // Basic (non rich) test file
    String filename = dirname + "/basic_test_ppt_file.ppt";
    hss = new HSLFSlideShow(filename);
    ss = new SlideShow(hss);
   
    // Rich test file
    filename = dirname + "/Single_Coloured_Page.ppt";
    hssRich = new HSLFSlideShow(filename);
    ssRich = new SlideShow(hssRich);
  }
View Full Code Here

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

    String dirnameHWPF = System.getProperty("HWPF.testdata.path");
    String filenameHWPF = dirnameHWPF + "/test2.doc";
   
    FileInputStream fisHSLF = new FileInputStream(filenameHSLF);
    pfs = new POIFSFileSystem(fisHSLF);
    doc = new HSLFSlideShow(pfs);
   
    FileInputStream fisHWPF = new FileInputStream(filenameHWPF);
    pfs2 = new POIFSFileSystem(fisHWPF);
    doc2 = new HWPFDocument(pfs2);
  }
View Full Code Here

Examples of org.apache.poi.hslf.HSLFSlideShow

    private SlideShow pptB;

    protected void setUp() throws Exception {
    String dirname = System.getProperty("HSLF.testdata.path");
    String filename = dirname + "/empty.ppt";
    ppt = new SlideShow(new HSLFSlideShow(filename));
   
    String filenameB = dirname + "/empty_textbox.ppt";
    pptB = new SlideShow(new HSLFSlideShow(filenameB));
    }
View Full Code Here

Examples of org.apache.poi.hslf.HSLFSlideShow

        ppt.write(out);
        out.close();

        //read ppt from byte array

        ppt = new SlideShow(new HSLFSlideShow(new ByteArrayInputStream(out.toByteArray())));
        assertEquals(1, ppt.getSlides().length);

        slide = ppt.getSlides()[0];
        Shape[] shape = slide.getShapes();
        assertEquals(2, shape.length);
View Full Code Here

Examples of org.apache.poi.hslf.HSLFSlideShow

     * @throws Exception
     */
    public void testTextBoxRead() throws Exception {
        String dirname = System.getProperty("HSLF.testdata.path");
        String filename = dirname + "/with_textbox.ppt";
        ppt = new SlideShow(new HSLFSlideShow(filename));
        Slide sl = ppt.getSlides()[0];
        Shape[] sh = sl.getShapes();
        for (int i = 0; i < sh.length; i++) {
            assertTrue(sh[i] instanceof TextBox);
            TextBox txtbox = (TextBox)sh[i];
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())));

        txtbox = (TextBox)sl.getShapes()[0];
        rt = txtbox.getTextRun().getRichTextRuns()[0];

        // Check after save
View Full Code Here

Examples of org.apache.poi.hslf.HSLFSlideShow

        textBoxSet("/incorrect_slide_order.ppt");
    }

    private void textBoxSet(String filename) throws Exception {
        String dirname = System.getProperty("HSLF.testdata.path");
        SlideShow ppt = new SlideShow(new HSLFSlideShow(dirname + filename));
        Slide[] sl = ppt.getSlides();
        for (int k = 0; k < sl.length; k++) {
            ArrayList lst1 = new ArrayList();
            TextRun[] txt = sl[k].getTextRuns();
            for (int i = 0; i < txt.length; i++) {
View Full Code Here

Examples of org.apache.poi.hslf.HSLFSlideShow

    if(args.length < 1) {
      System.err.println("Need to give a filename");
      System.exit(1);
    }

    HSLFSlideShow ss = new HSLFSlideShow(args[0]);

    // Find the documents, and then their SLWT
    Record[] records = ss.getRecords();
    for(int i=0; i<records.length; i++) {
      if(records[i] instanceof Document) {
        Document doc = (Document)records[i];
        SlideListWithText[] slwts = doc.getSlideListWithTexts();
       
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.