Hi Aspose Team,
I’ve tried to mimic following fragment of html (VML) code in word using your library:
<v:shape
coordsize="200 200"
strokecolor="red" fillcolor="red"
style="top:10pt;left:10pt;width:50pt;height:50pt">
<v:textbox
inset="10px, 10px, 10px, 10px">
VML
</v:textbox>
</v:shape>
Basically, I’d like to have an Textbox with some text inside other shape. Please check the code bellow for replication. All works fine up to the moment where I’m adding text to the textbox shape (two commented lines of code). When you uncomment them - document is created, but displays an error when opened in Word (2016):
public void Test()
{
var doc = new Document();
var body = new Body(doc);
var section = new Section(doc);
doc.AppendChild(section);
section.AppendChild(body);
var para = new Paragraph(doc);
var shape = new Shape(doc, ShapeType.Rectangle)
{
CoordSize = new Size(1000, 1000),
StrokeColor = Color.Black,
FillColor = Color.Aqua
};
var shape2 = new Shape(doc, ShapeType.TextBox)
{
CoordSize = new Size(1000, 1000),
StrokeColor = Color.Black,
FillColor = Color.Aqua
};
para.AppendChild(shape);
var para2 = new Paragraph(doc);
var para3 = new Paragraph(doc);
para2.AppendChild(shape2);
shape.AppendChild(para2);
//shape2.AppendChild(para3);
//para3.AppendChild(new Run(doc, "test"));
body.AppendChild(para);
doc.Save("TestNewDoc.docx");
}
Could you please take a look what’s causing this behavior and, if possible, give me some clues how to achieve the results described at the beginning?
Thanks,
Mateusz