如何将图像插入到MS Word文档的页脚中

时间:2015-05-18 16:48:43

标签: c# ms-word

我遇到了麻烦。

我创建了一个项目,我需要通过将图像插入页面底部来更改MS Word文档的每个页面。我可以使用Spire.DOC将图像插入页脚,但每个页面的图像都相同。所以问题是在每个页面上插入不同的图像。任何人都可以帮助我如何实施它?谢谢!

示例,如何使用Spire.DOC插入图像

//Insert an image into footer paragraph
Paragraph footer = footer.AddParagraph();
DocPicture image = footer.AppendPicture(Image.FromFile("some_image.jpg");

//The alignment of the footer picture
image.TextWrappingStyle = TextWrappingStyle.Behind;
image.HorizontalOrigin = HorizontalOrigin.Page;
image.HorizontalAlignment = ShapeHorizontalAlignment.Center;
image.VerticalOrigin = VerticalOrigin.Page;
image.VerticalAlignment = ShapeVerticalAlignment.Bottom;

//Set the text of the footer
TextRange text = footer.AppendText("some_document.Doc";
text.CharacterFormat.FontName = "Arial";
text.CharacterFormat.FontSize = 11;
text.CharacterFormat.Italic = false;
footer.Format.HorizontalAlignment = Spire.Doc.Documents.HorizontalAlignment.Center;

//Add a border of the footer
footer.Format.Borders.Bottom.BorderType = Spire.Doc.Documents.BorderStyle.Single;
footer.Format.Borders.Bottom.Space = 0.06F;

0 个答案:

没有答案