We are using Aspose.Words Textbox object to render text. As this control has left and top properties which use can set to decide the position of the control on the document.
If user provides the input for a textbox object as follows,
textbox.left = 50;
textbox.top = 100;
for a A4 size page setting.
How could we measure the accuracy of the left and top properties after the document is rendered using above inputs.
I mean how could we check that the assigned values are taken and used by Aspose.Words appropriately.
Hi<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />
Thanks for your request. You can open the generated document using MS Word, right click on the textbox, select “Format Text Box”, select “Layout” tab and click “Advanced” button. In the shown form you can see position of the shape. Here is code I used for testing:
Document doc = new Document();
Shape textbox = new Shape(doc, ShapeType.TextBox);
Paragraph par = new Paragraph(doc);
par.AppendChild(new Run(doc, "test"));
textbox.Width = 100;
textbox.Height = 100;
textbox.Left = 50;
textbox.Top = 100;