Package org.apache.poi.hwpf.model

Examples of org.apache.poi.hwpf.model.PicturesTable


    }

    public void testEquation()
    {
        HWPFDocument doc = HWPFTestDataSamples.openSampleFile( "equation.doc" );
        PicturesTable pictures = doc.getPicturesTable();

        final List<Picture> allPictures = pictures.getAllPictures();
        assertEquals( 1, allPictures.size() );

        Picture picture = allPictures.get( 0 );
        assertNotNull( picture );
        assertEquals( PictureType.EMF, picture.suggestPictureType() );
View Full Code Here


     *  \u0001 which has the offset. More than one can
     *  reference the same \u0001
     */
    public void testFloatingPictures() throws Exception {
       HWPFDocument doc = HWPFTestDataSamples.openSampleFile("FloatingPictures.doc");
       PicturesTable pictures = doc.getPicturesTable();
      
       // There are 19 images in the picture, but some are
       //  duplicate floating ones
       assertEquals(17, pictures.getAllPictures().size());
      
       int plain8s = 0;
       int escher8s = 0;
       int image1s = 0;
      
       Range r = doc.getRange();
       for(int np=0; np < r.numParagraphs(); np++) {
          Paragraph p = r.getParagraph(np);
          for(int nc=0; nc < p.numCharacterRuns(); nc++) {
             CharacterRun cr = p.getCharacterRun(nc);
             if(pictures.hasPicture(cr)) {
                image1s++;
             } else if(pictures.hasEscherPicture(cr)) {
                escher8s++;
             } else if(cr.text().startsWith("\u0008")) {
                plain8s++;
             }
          }
View Full Code Here

        addTextIfAny(xhtml, "header", wordExtractor.getHeaderText());

        // Grab the list of pictures. As far as we can tell,
        //  the pictures should be in order, and may be directly
        //  placed or referenced from an anchor
        PicturesTable pictureTable = document.getPicturesTable();
        PicturesSource pictures = new PicturesSource(document);
       
        // Do the main paragraph text
        Range r = document.getRange();
        for(int i=0; i<r.numParagraphs(); i++) {
View Full Code Here

        addTextIfAny(xhtml, "header", wordExtractor.getHeaderText());

        // Grab the list of pictures. As far as we can tell,
        //  the pictures should be in order, and may be directly
        //  placed or referenced from an anchor
        PicturesTable pictureTable = document.getPicturesTable();
        PicturesSource pictures = new PicturesSource(document);
       
        // Do the main paragraph text
        Range r = document.getRange();
        for(int i=0; i<r.numParagraphs(); i++) {
View Full Code Here

        addTextIfAny(xhtml, "header", wordExtractor.getHeaderText());

        // Grab the list of pictures. As far as we can tell,
        //  the pictures should be in order, and may be directly
        //  placed or referenced from an anchor
        PicturesTable pictureTable = document.getPicturesTable();
        PicturesSource pictures = new PicturesSource(document);
       
        // Do the main paragraph text
        Range r = document.getRange();
        for(int i=0; i<r.numParagraphs(); i++) {
View Full Code Here

        addTextIfAny(xhtml, "header", wordExtractor.getHeaderText());

        // Grab the list of pictures. As far as we can tell,
        //  the pictures should be in order, and may be directly
        //  placed or referenced from an anchor
        PicturesTable pictureTable = document.getPicturesTable();
        PicturesSource pictures = new PicturesSource(document);
       
        // Do the main paragraph text
        Range r = document.getRange();
        for(int i=0; i<r.numParagraphs(); i++) {
View Full Code Here

        HeaderStories headerFooter = new HeaderStories(document);

        // Grab the list of pictures. As far as we can tell,
        //  the pictures should be in order, and may be directly
        //  placed or referenced from an anchor
        PicturesTable pictureTable = document.getPicturesTable();
        PicturesSource pictures = new PicturesSource(document);

        // Do any headers, if present
        Range[] headers = new Range[] { headerFooter.getFirstHeaderSubrange(),
                headerFooter.getEvenHeaderSubrange(), headerFooter.getOddHeaderSubrange() };
View Full Code Here

TOP

Related Classes of org.apache.poi.hwpf.model.PicturesTable

Copyright © 2018 www.massapicom. 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.