Copy link to clipboard
Copied
Hello,
In our plugin we sometimes need to change a text frame to an image frame.
Currently, using the SDK, we save the text frame's size, position, and the layer on which it is, and the create an picture frame of the same size, position and on the same layer (and then delete the text frame). This works, but limits us to transparent rectangular picture frames.
Is there a way, using the SDK, to change a text frame's contents from text to picture ?
We are able to do it for an empty text frame, but as soon as the text frame has had any text in it, it becomes impossible to change it to a picture frame.
Very best regards,
Olivier
You can load the place gun via ImportAndLoadPlaceGun, pick up the item via GetFirstPlaceGunItemUID. Both the image (source) and the existing spline item (target) have an IPlaceBehavior, use the source's ProcessPlace(). If the spline already has an image, use the target's ProcessReplace() instead.
Copy link to clipboard
Copied
@Olivier Beltrami said:
"We are able to do it for an empty text frame, but as soon as the text frame has had any text in it, it becomes impossible to change it to a picture frame."
Hi Olivier,
just a remark about this behavior: it follows exactly the behavior of the same function in the GUI.
If a text frame contains text the option to convert it to a graphic frame is grayed out.
Regards,
Uwe Laubender
( Adobe Community Professional )
Copy link to clipboard
Copied
Hi Uwe,
Thank you very much @Laubender .
I now clear the frame of existing text and my frames' content type is now modifiable in the UI.
However, I am not able to find any API call to import/place an image into an existing frame. All the ones I see, such as SDKLayoutHelper::PlaceFileInFrame() create a new frame. Is there an API call to place a graphic into an existing frame ?
Very best regards,
Olivier
Copy link to clipboard
Copied
You can load the place gun via ImportAndLoadPlaceGun, pick up the item via GetFirstPlaceGunItemUID. Both the image (source) and the existing spline item (target) have an IPlaceBehavior, use the source's ProcessPlace(). If the spline already has an image, use the target's ProcessReplace() instead.
Copy link to clipboard
Copied
Thank you very much.
We'll follow your suggestion.
Olivier
Copy link to clipboard
Copied
Hi Olivier,
I am trying to implement setting endnote programatically, I am inserting endnote with following options
iEndnoteSettings->SetScope(IEndnoteSettings::Scope::kStory);
iEndnoteSettings->SetPlace(IEndnoteSettings::Place::kPlacegun);
So I have IPlaceBehavior for source, I want to add/place this on same Page at bottom as new item but not able to understand how to user ProcessPlace()
Can you please explain how to do this, it will be helpful if you can share your code snippet for ProcessPlace
I have also posted question on forum for this you can reply there also
Thanks!!