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.

Mon Jul 23, 2018 1:08 pm

Hello,

In some cases, the PDF does not display the watermark.
Result PDF's dimension it's bigger then the original PDF.
No errors are released by the library.

We cannot identify the reason why watermark it's not visible or if it not exists at all in the PDF.

Below the function used by the tool:

Code: Select all
static void SetWaterMark(PdfPageBase page, string stampString, float trasparency, float size, int rotation, string fontFamily = "TimesRoman", string fontStyle = "Regular")
        {
            try
            {
                PdfTilingBrush brush = new PdfTilingBrush(new SizeF(page.Canvas.ClientSize.Width / 2 + page.Canvas.ClientSize.Width / 2,
                                                                    page.Canvas.ClientSize.Height / 2 + page.Canvas.ClientSize.Height / 2));
                brush.Graphics.SetTransparency(trasparency);
                brush.Graphics.Save();
                brush.Graphics.TranslateTransform(brush.Size.Width / 2, brush.Size.Height / 2);
                brush.Graphics.RotateTransform(rotation);
                brush.Graphics.DrawString(stampString,
                                          new PdfFont(ParseEnum<PdfFontFamily>(fontFamily), 130, ParseEnum<PdfFontStyle>(fontStyle)),
                                          PdfBrushes.LightGray,
                                          0,
                                          0,
                                          new PdfStringFormat(PdfTextAlignment.Center, PdfVerticalAlignment.Middle));
                brush.Graphics.Restore();
                brush.Graphics.SetTransparency(trasparency);
                page.Canvas.DrawRectangle(brush, new RectangleF(new PointF(0, 0), page.Canvas.ClientSize));
            }
            catch (Exception ex)
            {
                Log(ex.Message);
            }
        }


My best regards.

Fincad
 
Posts: 4
Joined: Mon Jul 23, 2018 12:49 pm

Tue Jul 24, 2018 2:35 am

Dear Fincad,

Thanks for your inquiry.
I tested your case with Free Spire.PDF for .NET Version:4.3, the watermark displayed on PDF correctly. Here is my testing code:
Code: Select all
        private void button40_Click(object sender, EventArgs e)
        {
            PdfDocument doc = new PdfDocument();
            PdfPageBase page = doc.Pages.Add();
            SetWaterMark(page, "watermark", 10, 10, 45);
            doc.SaveToFile("result14475.pdf");
            System.Diagnostics.Process.Start("result14475.pdf");
        }
       private static void SetWaterMark(PdfPageBase page, string stampString, float trasparency, float size, int rotation, string fontFamily = "TimesRoman", string fontStyle = "Regular")
        {

                PdfTilingBrush brush = new PdfTilingBrush(new SizeF(page.Canvas.ClientSize.Width / 2 + page.Canvas.ClientSize.Width / 2,
                                                                    page.Canvas.ClientSize.Height / 2 + page.Canvas.ClientSize.Height / 2));
                brush.Graphics.SetTransparency(trasparency);
                brush.Graphics.Save();
                brush.Graphics.TranslateTransform(brush.Size.Width / 2, brush.Size.Height / 2);
                brush.Graphics.RotateTransform(rotation);

                brush.Graphics.DrawString(stampString,
                                          new PdfFont(PdfFontFamily.TimesRoman, 130, PdfFontStyle.Regular),
                                          PdfBrushes.LightGray,
                                          0,
                                          0,
                                          new PdfStringFormat(PdfTextAlignment.Center, PdfVerticalAlignment.Middle));
                brush.Graphics.Restore();
                brush.Graphics.SetTransparency(trasparency);
                page.Canvas.DrawRectangle(brush, new RectangleF(new PointF(0, 0), page.Canvas.ClientSize));
        }

I also attached my result file. What are the parameters when calling your customized function ? Could you please share us your input document(if any), result pdf and full code for further investigation ?

Many thanks,
Betsy
E-iceblue support team
User avatar

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

Fri Jul 27, 2018 9:37 am

Dear Fincad,

Greetings from E-iceblue.
How is your issue going now ? Could you please give us some feedback at your convenience ?

Sincerely,
Betsy
E-iceblue support team
User avatar

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

Tue Jul 31, 2018 9:32 am

Betsy.jiang wrote:Dear Fincad,

Thanks for your inquiry.
I tested your case with Free Spire.PDF for .NET Version:4.3, the watermark displayed on PDF correctly. Here is my testing code:
Code: Select all
        private void button40_Click(object sender, EventArgs e)
        {
            PdfDocument doc = new PdfDocument();
            PdfPageBase page = doc.Pages.Add();
            SetWaterMark(page, "watermark", 10, 10, 45);
            doc.SaveToFile("result14475.pdf");
            System.Diagnostics.Process.Start("result14475.pdf");
        }
       private static void SetWaterMark(PdfPageBase page, string stampString, float trasparency, float size, int rotation, string fontFamily = "TimesRoman", string fontStyle = "Regular")
        {

                PdfTilingBrush brush = new PdfTilingBrush(new SizeF(page.Canvas.ClientSize.Width / 2 + page.Canvas.ClientSize.Width / 2,
                                                                    page.Canvas.ClientSize.Height / 2 + page.Canvas.ClientSize.Height / 2));
                brush.Graphics.SetTransparency(trasparency);
                brush.Graphics.Save();
                brush.Graphics.TranslateTransform(brush.Size.Width / 2, brush.Size.Height / 2);
                brush.Graphics.RotateTransform(rotation);

                brush.Graphics.DrawString(stampString,
                                          new PdfFont(PdfFontFamily.TimesRoman, 130, PdfFontStyle.Regular),
                                          PdfBrushes.LightGray,
                                          0,
                                          0,
                                          new PdfStringFormat(PdfTextAlignment.Center, PdfVerticalAlignment.Middle));
                brush.Graphics.Restore();
                brush.Graphics.SetTransparency(trasparency);
                page.Canvas.DrawRectangle(brush, new RectangleF(new PointF(0, 0), page.Canvas.ClientSize));
        }

I also attached my result file. What are the parameters when calling your customized function ? Could you please share us your input document(if any), result pdf and full code for further investigation ?

Many thanks,
Betsy
E-iceblue support team


Good morning Betsy,
looking at our project references, i noticed that Spire.Pdf.dll Product Version used by us is 3.2.52.56035,
while installing Free Spire.PDF for .NET Version:4.3 the Spire.Pdf.dll Product Version is 4.3.0.20035.
I will try using this new one over some PDF signaled by our customer.

Best regards.

Fincad
 
Posts: 4
Joined: Mon Jul 23, 2018 12:49 pm

Tue Jul 31, 2018 9:41 am

Dear Fincad,

Good morning.
If the issue still happens after trying the version, please share us your input document(if any), result pdf and full code for further investigation. Look forward to your feedback.

Sincerely,
Betsy
E-iceblue support team
User avatar

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

Tue Oct 30, 2018 4:08 pm

Betsy.jiang wrote:Dear Fincad,

Good morning.
If the issue still happens after trying the version, please share us your input document(if any), result pdf and full code for further investigation. Look forward to your feedback.

Sincerely,
Betsy
E-iceblue support team

Good evening,

sorry for the big delay, only now our customer authorized us.
Please, take a look to the zip in attachments, it contains the original PDF, the edited result PDF and C# code.

Thank you.

Fincad
 
Posts: 4
Joined: Mon Jul 23, 2018 12:49 pm

Wed Oct 31, 2018 3:11 am

Dear Fincad,

Thanks for your detailed information.
Sorry for the inconvenience caused by our free version. I have confirmed that your case worked well using Spire.PDF Pack(Hot Fix) Version:4.10.3. Sorry that we have no plan to maintain free version, so please use the version I mentioned.
In addition, to help you evaluate our product better, our sales team has sent you a one-month free license of Spire.PDF via Email to help you remove the warning message. Here is a guide to apply license:
https://www.e-iceblue.com/Tutorials/Lic ... ply_by_Key
If there is any question, welcome to get it back to us.

Sincerely,
Betsy
E-iceblue support team
User avatar

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

Fri Nov 02, 2018 4:51 pm

Works fine thank you.

Fincad
 
Posts: 4
Joined: Mon Jul 23, 2018 12:49 pm

Mon Nov 05, 2018 1:31 am

Dear Fincad,

Thanks for your feedback.
Any question, welcome to get it back to us.
Wish you all the best!

Sincerely,
Betsy
E-iceblue support team
User avatar

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

Fri Jan 10, 2020 6:30 am

Hi Team,

I am converting a Word file to PDF. And I am not able to remove the watermark ("Evaluation Warning : The document was created with Spire.PDF for .NET.").
Requesting any of your help.

Thanks,
Vamsichaitanya

Vamsichaitanyach
 
Posts: 1
Joined: Fri Jan 10, 2020 6:23 am

Fri Jan 10, 2020 7:58 am

Hi,

Thanks for your inquiry.
Kindly note that the function of converting Word file to Pdf file is in Spire.Doc. And there will be the warning message without applying our license file while using our commercial products.
Our sales team just sent you a one-month free license of Spire.Doc to help you remove the warning information. Please check and apply it to have a better evaluation on our product. Here is a guide for you: https://www.e-iceblue.com/Tutorials/Licensing/Licensing.html.

Best wishes,
Amber
E-iceblue support team
User avatar

Amber.Gu
 
Posts: 525
Joined: Tue Jun 04, 2019 3:16 am

Return to Spire.PDF