I want to write text on shape (not on path) without creating new textbox reffering adobe indesign sdk 2022 functions.for example ,write text on rectangle.How to write it using sdk functions.
you can draw any closed shape you want with pen tool for example, or creat any shape, just go to type tool, click inside the shape and start writing or paste a text inside..
or righ mouse click on the shape> content> Text
It is from UI side. I know how to add text on shape. I want to know about (command/function) for it from indesign sdk .
"I know how to add text on shape" - actually it would have been a good idea to desribe in UI terms what you're trying to achieve.
Assuming it is indeed the step described by Manal, that would be kConvertItemToTextCmdBoss where the UIDList is your kSplineItemBoss. The command invokes others such as kNewStoryCmdBoss, kNewFrameCmdBoss and so forth, so it will create a text frame (not box) and combine it with your shape.
For example to add text on path
kAddTextOnPathCmdBoss is command is used for it .
Hi @Madhuri1 ,
I'm not exactly sure what you like to do and I cannot help you with the SDK side of things here, but you could do perhaps the following:
Let's assume you have one text frame (TF) with one path and a graphic frame (GF) with an arbitrary shape with one path. Spoken in ExtendScript terms you could set the entirePath array of the first path of the TF to the entirePath array of the first path of the GF to shape the text frame according to the path of the graphic frame.
//ExtendScript var TF = app.selection; var GF = app.selection; TF.paths.entirePath = GF.paths.entirePath;
After script run:
Of course this is a very simplistic approach and does not account for example the transformation of an object.
( Adobe Community Professional )