Dear Lucy,
Thanks for your inquiry.
After an initial test with following code, I noted the property BackgroundRegion doesn't work using Spire.Office(2.16.23), so the watermark image always stretches through the whole page. Did you use same code ? If not, please provide us with your code and related files. Besides, I have logged the issue on BackgroundRegion in our bug tracking system.
- Code: Select all
PdfDocument pdf = new PdfDocument();
PdfPageBase page = pdf.Pages.Add();
Image img = Image.FromFile(@"F:\image\image1.jpg");
page.BackgroundImage = img;
page.BackgroundRegion = new RectangleF(300, 200, 80, 81);
pdf.SaveToFile("12807.pdf");
If you encounter same issue, there is a temporary solution for you , please first set the BackgroundRegion and then add image.
- Code: Select all
page.BackgroundRegion = new RectangleF(300, 200, 80, 81);
page.BackgroundImage = img;
Sincerely,
Betsy
E-iceblue support team