Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
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
Copy link to clipboard
Copied
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 .
Copy link to clipboard
Copied
"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.
Copy link to clipboard
Copied
For example to add text on path
kAddTextOnPathCmdBoss is command is used for it .
Copy link to clipboard
Copied
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[0];
var GF = app.selection[1];
TF.paths[0].entirePath = GF.paths[0].entirePath;
Before:
After script run:
Of course this is a very simplistic approach and does not account for example the transformation of an object.
Regards,
Uwe Laubender
( Adobe Community Professional )