Following steps from this site:
https://smallbusiness.chron.com/merge-pictures-word-53827.html
Open blank word document.
Select Insert, Pictures
Find Pictures and select both and select insert.
Pictures come on two different pages.
Click on each picture and select Format, Wrap Text, Square.
Take 2nd picture and move up to first picture.
Expand picture to cover entire borders.
On picture, right click and Send to Back.
Result is attached.
How can it be done with DocIO?
Regards
|
//Creates a new word document
WordDocument wordDocument = new WordDocument();
//Adds new section to the document
IWSection section = wordDocument.AddSection();
//Defines the pagesize
section.PageSetup.PageSize = PageSize.Letter;
section.PageSetup.Margins.All = 72;
//Adds new paragraph to the section
IWParagraph firstParagraph = section.AddParagraph();
IWPicture picture = firstParagraph.AppendPicture(Image.FromFile("..//..//Data//image1.jpeg"));
//Sets the wrapping style for the image as Square
picture.TextWrappingStyle = TextWrappingStyle.Square;
//Sets the horizontal and vertical origin
picture.HorizontalOrigin = HorizontalOrigin.Margin;
picture.VerticalOrigin = VerticalOrigin.Paragraph;
//Sets the horizontal alignment
picture.HorizontalAlignment = ShapeHorizontalAlignment.Right;
//Sets the vertical postion
picture.VerticalPosition = 176.25f;
picture = firstParagraph.AppendPicture(Image.FromFile("..//..//Data//image2.png"));
//Sets the horizontal and vertical origin
picture.HorizontalOrigin = HorizontalOrigin.Margin;
picture.VerticalOrigin = VerticalOrigin.Paragraph;
//Sets the horizontal alignment
picture.HorizontalAlignment = ShapeHorizontalAlignment.Right;
//Sets the wrapping style for the image as Square
picture.TextWrappingStyle = TextWrappingStyle.Square;
//Saving the word document
wordDocument.Save("Sample_DocIO.docx", FormatType.Docx); |
Hi Mangesh,Thank you for contacting Syncfusion support. You can achieve your requirement by using the following code snippet.Code snippet:
//Creates a new word documentWordDocument wordDocument = new WordDocument();//Adds new section to the documentIWSection section = wordDocument.AddSection();//Defines the pagesizesection.PageSetup.PageSize = PageSize.Letter;section.PageSetup.Margins.All = 72;//Adds new paragraph to the sectionIWParagraph firstParagraph = section.AddParagraph();IWPicture picture = firstParagraph.AppendPicture(Image.FromFile("..//..//Data//image1.jpeg"));//Sets the wrapping style for the image as Squarepicture.TextWrappingStyle = TextWrappingStyle.Square;//Sets the horizontal and vertical originpicture.HorizontalOrigin = HorizontalOrigin.Margin;picture.VerticalOrigin = VerticalOrigin.Paragraph;//Sets the horizontal alignmentpicture.HorizontalAlignment = ShapeHorizontalAlignment.Right;//Sets the vertical postionpicture.VerticalPosition = 176.25f;picture = firstParagraph.AppendPicture(Image.FromFile("..//..//Data//image2.png"));//Sets the horizontal and vertical originpicture.HorizontalOrigin = HorizontalOrigin.Margin;picture.VerticalOrigin = VerticalOrigin.Paragraph;//Sets the horizontal alignmentpicture.HorizontalAlignment = ShapeHorizontalAlignment.Right;//Sets the wrapping style for the image as Squarepicture.TextWrappingStyle = TextWrappingStyle.Square;//Saving the word documentwordDocument.Save("Sample_DocIO.docx", FormatType.Docx);Please let us know if you need further assistance.Regards,
Prakash Kumar