Spire.PDF is a professional PDF library applied to creating, writing, editing, handling and reading PDF files without any external dependencies. Get free and professional technical support for Spire.PDF for .NET, Java, Android, C++, Python.

Thu Feb 01, 2018 9:56 pm

I am working on PDF file generating with new version of Spire.Office(2.16.23). However, the watermark image is not showing properly. I noticed the following statement is obsoleted in the new version:
UseHighQualityImage
so I changed my code accordingly, but the watermark image still seems to stretch through the whole page. I down graded Spire Office to 2.15 and it works fine.
Could you please take a look this issue?

Thanks,
Lucy

lsong
 
Posts: 36
Joined: Wed Feb 01, 2017 4:13 pm

Fri Feb 02, 2018 2:48 am

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
User avatar

Betsy.jiang
 
Posts: 3099
Joined: Tue Sep 06, 2016 8:30 am

Mon Feb 05, 2018 8:47 am

Dear Lucy,

Greetings from E-iceblue.
Did you encounter the same issue as mine ? If not, please provide us with your code and related files for further investigation.

Sincerely,
Betsy
E-iceblue support team
User avatar

Betsy.jiang
 
Posts: 3099
Joined: Tue Sep 06, 2016 8:30 am

Mon Feb 05, 2018 7:56 pm

This is the code snippet of our application:

foreach (PdfPageBase loPage in loPDF.Pages)
{
loPage.BackgroundImage = loImage;
loPage.BackgroundRegion = new RectangleF(foatWatermarkPositionX, foatWatermarkPositionY, loImage.Size.Width, loImage.Size.Height);
}
The watermark image always stretches through the whole page with Spire.Office(2.16.23). It is working fine with Spire.Office(2.15)

lsong
 
Posts: 36
Joined: Wed Feb 01, 2017 4:13 pm

Tue Feb 06, 2018 1:58 am

Dear Lucy,

Thanks for your response.
Your issue is the one I mentioned before, please first use the temporary solution if you could. And the issue has been fixed and it is under testing phase now, we will let you know when the hotfix of Spire.Office is available.

Sincerely,
Betsy
E-iceblue support team
User avatar

Betsy.jiang
 
Posts: 3099
Joined: Tue Sep 06, 2016 8:30 am

Sun Feb 11, 2018 9:55 am

Dear Lucy,

Thanks for waiting.
Now the issue has been fixed in Spire.Office Platinum (DLL Only) Version:2.16.27.
Looking forward to your feedback.

Sincerely,
Betsy
E-iceblue support team
User avatar

Betsy.jiang
 
Posts: 3099
Joined: Tue Sep 06, 2016 8:30 am

Mon Feb 12, 2018 3:32 am

Dear Lucy,

Greetings from E-iceblue.
Did you use the hotfix ? Has your issue been resolved ?

Sincerely,
Betsy
E-iceblue support team
User avatar

Betsy.jiang
 
Posts: 3099
Joined: Tue Sep 06, 2016 8:30 am

Return to Spire.PDF