Hi there!
Hi Michael,
DocumentBuilder builder = new DocumentBuilder();<o:p></o:p>
PageSetup ps = builder.PageSetup;
Shape shape = builder.InsertImage(@"C:\Temp\Aspose.Words.png");
shape.WrapType = WrapType.None;
shape.Left = 0 - ps.LeftMargin;
shape.Top = 0 - ps.TopMargin;
builder.Document.Save(@"C:\Temp\out.docx");
LayoutCollector collector = new LayoutCollector(doc);
Paragraph anchorPara = null;
NodeCollection paragraphs = doc.GetChildNodes(NodeType.Paragraph, true);
foreach (Paragraph para in paragraphs)
{
if (collector.GetStartPageIndex(para) == 2)
{
anchorPara = para;
break;
}
}
DocumentBuilder builder = new DocumentBuilder(doc);
PageSetup ps = builder.PageSetup;
builder.MoveToParagraph(paragraphs.IndexOf(anchorPara), 0);
Shape shape = builder.InsertImage(@"C:\Temp\Aspose.Words.png");
shape.WrapType = WrapType.None;
shape.Left = 0 - ps.LeftMargin;
shape.Top = 0 - ps.TopMargin;
builder.Document.Save(@"C:\Temp\out.docx");
Hi Awais,
The issues you have found earlier (filed as WORDSNET-4977) have been fixed in this Aspose.Words for .NET 17.10 update and this Aspose.Words for Java 17.10 update.
Please see Aspose.Words.Wrapper.Samples.sln at GitHub (A wrapper for common methods by Aspose.Words for .NET).