Hello,
I process a mailmerge and I add a background image to the document.
The background image is correct in the .doc document but when I save it into a pdf file, the background is not showing.
Here the code to adding the background after the merge :
PageInfo pi = document.GetPageInfo (0);
Shape bg = new Shape (document, ShapeType.Image);
bg.ImageData.SetImage (this.fileRetriever(urlOrPathImage));
bg.RelativeHorizontalPosition = RelativeHorizontalPosition.Page;
bg.HorizontalAlignment = Aspose.Words.Drawing.HorizontalAlignment.Left;
bg.RelativeVerticalPosition = RelativeVerticalPosition.Page;
bg.VerticalAlignment = Aspose.Words.Drawing.VerticalAlignment.Top;
bg.Left = 0;
bg.Top = 0;
bg.Width = pi.WidthInPoints;
bg.Height = pi.HeightInPoints;
bg.BehindText = true;
Aspose.Words.Paragraph bpParagraph = new Aspose.Words.Paragraph (document);
bpParagraph.AppendChild (bg);
foreach (Aspose.Words.Section sect in document.Sections) {
// There could be up to three different headers in each section, since we want
// the watermark to appear on all pages, insert into all headers.
InsertParagraphIntoHeader (bpParagraph, sect, HeaderFooterType.HeaderPrimary);
InsertParagraphIntoHeader (bpParagraph, sect, HeaderFooterType.HeaderFirst);
InsertParagraphIntoHeader (bpParagraph, sect, HeaderFooterType.HeaderEven);
}
I’ve attached you the two result files.
Can you help me with this ?
Thank by advance.
Regards.