Category
Version
Please specify what version of the library you are using: [ 3.5.0 ]
Expected / Desired Behavior / Question
I need to add a radius to a rectangle shape when using the addText() method.
It should work as shown in the example provided from the documentation below
shape: pptx.shapes.ROUNDED_RECTANGLE,
x: 10,
y: 2.5,
w: 3.0,
h: 1.5,
r: 0.2,
fill: { color: "00FF00" },
align: "center",
fontSize: 14,
line: { color: "000000", size: 1, dashType: "dash" },
rectRadius: 10,
});
Observed Behavior
I am coding in TypeScript and cannot access the r: nor rectRadius: arguments.
I am using the method as below :
slide.addText("ROUNDED-RECTANGLE\ndashType:dash\nrectRadius:10", {
shape: pptx.shapeType.roundRect,
x: 10,
y: 2.5,
w: 3.0,
h: 1.5,
fill: { color: "00FF00" },
align: "center",
fontSize: 14,
line: { color: "000000", size: 1, dashType: "dash" },
rectRadius: 10,
});
And I receive the error
Argument of type '{ shape: PptxGenJS.ShapeType.rect; color: string; fontSize: Fonts; x: number; y: number; h: number; w: number; r: number; }' is not assignable to parameter of type 'TextPropsOptions'.
I tried all proposed rectangle shapes but none would work in my case if I need a custom radius.
Could you please check what is wrong here ?
Thanks