I’m testing to see if we can use Aspose.Words in a project. In the code in question, we have to position an image in the center of the right margin. Here is the code:
var doc = new Document(fileName); DocumentBuilder builder = new DocumentBuilder(doc); builder.MoveToHeaderFooter(HeaderFooterType.HeaderPrimary); var shape = builder.InsertImage(image, RelativeHorizontalPosition.RightMargin, 0.0, RelativeVerticalPosition.Page, 0.0, 40.0, 292.0, WrapType.None); shape.VerticalAlignment = VerticalAlignment.Center; shape.HorizontalAlignment = HorizontalAlignment.Center; doc.Save(outfile);
This code is working normally for .DOC, .DOCX, .RTF and .PDF formats, however, in .ODT format the image is in the center of the page instead of the center of the right margin.
Is there anything I can do to correct this problem, or is it a lib error?