Spire.Doc is a professional Word .NET library specifically designed for developers to create, read, write, convert and print Word document files. Get free and professional technical support for Spire.Doc for .NET, Java, Android, C++, Python.

Thu Feb 28, 2019 1:41 pm

Hi,

We found your product pretty useful and we are planning to purchase the same. Though we have one query regarding this product capabilities.
First , We have .doc file and we add watermark text on it.
the .doc file contains image content on it but watermark text not visible to us because it present behind the image.
we are stuck on that.
so, how we can able to show Watermark text on over content of image in .doc file ?

Second, we are not able to get the properties for watermark text to change the position like left,right,center.
as per our findings there are two options like :
txtWatermark.Layout = WatermarkLayout.Diagonal;
txtWatermark.Layout = WatermarkLayout.Horizontal;

so, how we can able to change Watermark text position in .doc.,pdf,.xls or Image files?

Thanks,
Vijay Shelar

vijayshelar
 
Posts: 1
Joined: Thu Feb 28, 2019 12:42 pm

Fri Mar 01, 2019 9:57 am

Hello,

Thanks for your post and below are my answers to your questions.
1). Regarding your requirement to show Watermark text on over content of image, our Spire.Doc supports setting transparent color for image to achieve it. Below is the sample code for your reference. If there is any question, please provide your original files as well as your desired effect of output for our reference, then we will look into it and guide you accordingly.
Code: Select all
 //load a document     
 Document document = new Document();
 document.LoadFromFile(@"sample.docx");
 //Set white color transparent
 foreach (Paragraph paragraph in document.Sections[0].Paragraphs)
 {
     foreach (DocumentObject docObj in paragraph.ChildObjects)
     {
         if (docObj.DocumentObjectType == DocumentObjectType.Picture)
         {
             DocPicture picture = docObj as DocPicture;
             picture.TransparentColor = Color.White;
         }
     }
 }
 //add txtWatermark
 TextWatermark txtWatermark = new TextWatermark();
 txtWatermark.Text = "this is a sample";
 txtWatermark.FontSize = 45;
 txtWatermark.Color = Color.Black;
 txtWatermark.Layout = WatermarkLayout.Horizontal;
 document.Watermark = txtWatermark;
 //save file
 document.SaveToFile("result.docx", Spire.Doc.FileFormat.Docx2013);

2). Please note that our Spire.Doc based on the MS Word, it isn't supported in MS word to set Watermark text position (like left,right and center). Thus, our Spire.Doc does not support it.
3). As for your requirement to change Watermark text position in Excel file and in Pdf file, please provide your sample files to help us further look into it. You could send them to us via email (support@e-iceblue.com). Thanks in advance.
Besides, if you want to use two or more products in the same project, please use Spire.Office instead and reference the DLLS you need to avoid the DLL version incompatibility.

Sincerely,
Lisa
E-iceblue support team
User avatar

Lisa.Li
 
Posts: 1261
Joined: Wed Apr 25, 2018 3:20 am

Wed Mar 06, 2019 8:59 am

Hello,

Greetings from E-iceblue.
Could you let us know how is your issue going? Thanks in advance for your any feedback and time.

Sincerely,
Lisa
E-iceblue support team
User avatar

Lisa.Li
 
Posts: 1261
Joined: Wed Apr 25, 2018 3:20 am

Return to Spire.Doc