Package org.apache.poi

Examples of org.apache.poi.POIXMLException


            }

            //build a tree of POIXMLDocumentParts, this presentation being the root
            load(XSLFFactory.getInstance());
        } catch (Exception e){
            throw new POIXMLException(e);
        }
    }
View Full Code Here


            throw new RuntimeException("Missing resource 'empty.pptx'");
        }
        try {
            return OPCPackage.open(is);
        } catch (Exception e){
            throw new POIXMLException(e);
        }
    }
View Full Code Here

                    }
                    _slides.add(sh);
                }
            }
        } catch (XmlException e) {
            throw new POIXMLException(e);
        }
    }
View Full Code Here

            try {
                OutputStream out = img.getPackagePart().getOutputStream();
                out.write(pictureData);
                out.close();
            } catch (IOException e) {
                throw new POIXMLException(e);
            }
            return _pictures.size() - 1;
        } else {
            return _pictures.indexOf(img);
        }
View Full Code Here

     *
     * @return a <code>Rectangle2D</code> that is the bounds of this shape.
     */
    public Rectangle2D resizeToFitText(){
        Rectangle2D anchor = getAnchor();
        if(anchor.getWidth() == 0.throw new POIXMLException(
                "Anchor of the shape was not set.");
        double height = getTextHeight();
        height += 1; // add a pixel to compensate rounding errors
       
        anchor.setRect(anchor.getX(), anchor.getY(), anchor.getWidth(), height);
View Full Code Here

                try {
                    PackagePart imgPart = p.getRelatedPart(rel);
                    _data = new XSLFPictureData(imgPart, rel);
                }
                catch (Exception e) {
                    throw new POIXMLException(e);
                }
            }
        }
        return _data;
    }
View Full Code Here

        PackageRelationship blipRel = packagePart.getRelationship(blipId);
        PackagePart blipPart;
        try {
            blipPart = packagePart.getRelatedPart(blipRel);
        } catch (InvalidFormatException e){
            throw new POIXMLException(e);
        }
        XSLFPictureData data = new XSLFPictureData(blipPart, null);

        XMLSlideShow ppt = getSlideShow();
        int pictureIdx = ppt.addPicture(data.getData(), data.getPictureType());
View Full Code Here

            try {
                InputStream is = srcPafrt.getInputStream();
                IOUtils.copy(is, out);
                out.close();
            } catch (IOException e){
                throw new POIXMLException(e);
            }
            return part;
        else {
            // already exists
            return pkg.getPart(srcPafrt.getPartName());
View Full Code Here

     */
    public byte[] getData() {
        try {
            return IOUtils.toByteArray(getPackagePart().getInputStream());
        } catch (IOException e) {
            throw new POIXMLException(e);
        }
    }
View Full Code Here

            byte[] data;
            try {
                is = getPackagePart().getInputStream();
                data = IOUtils.toByteArray(is);
            } catch (IOException e) {
                throw new POIXMLException(e);
            } finally {
                try {
                    if (is != null) is.close();
                } catch (IOException e) {
                    throw new POIXMLException(e);
                }
            }
            this.checksum = IOUtils.calculateChecksum(data);
        }
        return this.checksum;
View Full Code Here

TOP

Related Classes of org.apache.poi.POIXMLException

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.