You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@poi.apache.org by bu...@apache.org on 2021/03/05 00:30:12 UTC
[Bug 65167] New: Not possible to set placeholder picture
https://bz.apache.org/bugzilla/show_bug.cgi?id=65167
Bug ID: 65167
Summary: Not possible to set placeholder picture
Product: POI
Version: 5.0.0-FINAL
Hardware: PC
Status: NEW
Severity: normal
Priority: P2
Component: XSLF
Assignee: dev@poi.apache.org
Reporter: Apache.Joren@Joren.me
Target Milestone: ---
In working with POI 5.0.0 (congratulations on the release!), there appears to
be no way to use picture data to fill a layout-defined picture placeholder.
Let's say I'm adding slides using the SlideLayout.PIC_TX layout. This layout
has three placeholders: Title, picture, and text. Calling
slide.getPlaceholders() only returns instances of XLSFAutoShape, which extend
XSLFTextShape, even for the picture placeholder. I would expect the picture
placeholder shape to provide a method similar to what XSLFPictureShape provides
for using XSLFPictureData to define the picture.
The workaround people appear to be using is to save the anchor of the picture
placeholder, delete the placeholder shape, then call
slide.createPicture(pictureData) and set the returned shape's anchor to the
same as the placeholder's. See e.g. the answer provided for
https://stackoverflow.com/questions/35721547/how-to-add-image-to-image-placeholder-added-in-pptx-using-apache-poi-api
This will "work" in the sense that the picture will be at the same location and
size the placeholder defined, but deleting the placeholder and replacing it
with a new shape means that the placeholder can't be used to interact with and
change the layout of the picture, either programmatically or as a user editing
the slide working with a slide master.
The shape returned by the getPlaceholder() call should be an abstract class
that the user could instance-check to see if it's a picture shape, a text
shape, or some other shape, and handle it accordingly.
Happy to provide further information as needed, and thanks for bearing with me
as a newbie to the Apache Bugzilla and to POI as well. Thank you,
-- Joren
--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org
[Bug 65167] Not possible to set placeholder picture
Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=65167
Dominik Stadler <do...@gmx.at> changed:
What |Removed |Added
----------------------------------------------------------------------------
OS| |All
Severity|normal |enhancement
--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org
[Bug 65167] Not possible to set placeholder picture
Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=65167
j.rabauer@xdev-software.de changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |j.rabauer@xdev-software.de
--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org