Example usage for org.apache.poi.hslf.usermodel HSLFSlideShow getPictureData

List of usage examples for org.apache.poi.hslf.usermodel HSLFSlideShow getPictureData

Introduction

In this page you can find the example usage for org.apache.poi.hslf.usermodel HSLFSlideShow getPictureData.

Prototype

@Override
    public List<HSLFPictureData> getPictureData() 

Source Link

Usage

From source file:org.apache.tika.parser.microsoft.HSLFExtractor.java

License:Apache License

private void handleSlideEmbeddedPictures(HSLFSlideShow slideshow, XHTMLContentHandler xhtml)
        throws TikaException, SAXException, IOException {
    for (HSLFPictureData pic : slideshow.getPictureData()) {
        String mediaType;//from   ww  w .j av a 2  s . c  o  m

        switch (pic.getType()) {
        case EMF:
            mediaType = "application/x-emf";
            break;
        case WMF:
            mediaType = "application/x-msmetafile";
            break;
        case DIB:
            mediaType = "image/bmp";
            break;
        default:
            mediaType = pic.getContentType();
            break;
        }

        handleEmbeddedResource(TikaInputStream.get(pic.getData()), null, null, mediaType, xhtml, false);
    }
}