Hi Support,
I am trying to set the margin left and right of a paragraph, but the code that I am trying is not taking effect. The default margin for a shape remains 0.25.
This is the piece of code I am running:
IAutoShape box = group.getShapes().addAutoShape(
ShapeType.Rectangle,
rctShape.getA().getX().floatValue(),
rctShape.getA().getY().floatValue(),
rctShape.getB().getX().floatValue() - rctShape.getA().getX().floatValue(),
rctShape.getB().getY().floatValue() - rctShape.getA().getY().floatValue());
box.getFillFormat().setFillType(FillType.Solid);
box.getFillFormat().getSolidFillColor().setColor(Color.WHITE);
box.getLineFormat().getFillFormat().getSolidFillColor().setColor(Color.black);
box.getLineFormat().getFillFormat().setFillType(FillType.Solid);
box.getLineFormat().setWidth(1);
box.addTextFrame(" ");
ITextFrame txtFrame = box.getTextFrame();
IParagraph iParagraph = txtFrame.getParagraphs().get_Item(0);
IPortion portion = iParagraph.getPortions().get_Item(0);
portion.getPortionFormat().getFillFormat().setFillType(FillType.Solid);
portion.getPortionFormat().getFillFormat().getSolidFillColor().setColor(Color.black);
portion.getPortionFormat().setFontHeight(10);
portion.getPortionFormat().setFontBold(NullableBool.True);
iParagraph.getParagraphFormat().setMarginLeft(0.01f); // also tried another values…
iParagraph.getParagraphFormat().setMarginRight(0.01f);
portion.setText(“My Text”);
Thank you.