ASF Bugzilla – Attachment 31874 Details for
Bug 56812
XSLFPictureData reference to linked picture file
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
Code to demonstrate null pointer error when picture is only linked (third picture in attached Powerpoint file).
linkedPicture.java (text/plain), 1.16 KB, created by
Geoff Wright
on 2014-08-04 16:03:30 UTC
(
hide
)
Description:
Code to demonstrate null pointer error when picture is only linked (third picture in attached Powerpoint file).
Filename:
MIME Type:
Creator:
Geoff Wright
Created:
2014-08-04 16:03:30 UTC
Size:
1.16 KB
patch
obsolete
>import org.apache.poi.xslf.usermodel.XMLSlideShow; >import org.apache.poi.xslf.usermodel.XSLFShape; >import org.apache.poi.xslf.usermodel.XSLFSlide; >import org.apache.poi.xslf.usermodel.XSLFPictureShape; >import org.apache.poi.xslf.usermodel.XSLFPictureData; > >import java.io.FileInputStream; > >/** > * Example to show different handling of embedded versus linked pictures > * > * @author Geoff Wright > */ >public class linkedPicture { > > public static void main(String[] args) throws Exception { > > XMLSlideShow ppt = new XMLSlideShow(new FileInputStream("linkedPicture.pptx")); > for(XSLFSlide slide : ppt.getSlides()){ > for(XSLFShape shape : slide.getShapes()){ > System.out.println(shape); > if(shape instanceof XSLFPictureShape){ > XSLFPictureData data = ((XSLFPictureShape) shape).getPictureData(); > try { > System.out.println(data.getFileName()); > } catch (NullPointerException e) { > System.err.println("Caught Exception: " + e.getMessage()); > e.printStackTrace(); > } > } > } > } > } >}
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 56812
:
31873
| 31874