Add Text Watermark and Image Watermark in Word

Text watermark and image watermark are all watermarks in Word document. The difference lies in that text watermark always shows some additional but related information to the word context. While image watermark is used to make the Word document be more attractive. This section will show you solutions to add both text watermark and image watermark via a .NET Word component in C#, VB.NET.

Spire.Doc for .NET, a reliable .NET Word component, enables you to generate, read, edit, convert even print your Word document in a fast speed. Using Spire.Doc for .NET, you can easily add both text watermark and image watermark in your Word document in C#, VB.NET. Please see the target Word document with image watermark as below picture:

Word Watermarks

Here, you can download Spire.Doc for .NET and install it in system. After adding Spire.Doc dll, you can perform adding Word watermark task by below soluctions.

Add Image Watermark in Word with C#, VB.NET

There are four lines of key code for you to add your image watermark. First we need to create a new instance of the Spire.Doc.PictureWatermark named picture. Then, load an image from system by calling the method: System.Drawing.Image FromFile(string filename). The third line enables you to set the image watermark scaling when adding to Word file. While in the last step, you can set the image that you just load to be Word watermark. Please see the code below:

[C#]
using Spire.Doc;
namespace AddWatermark
{
    class Program
    {
        static void Main(string[] args)
        {
            Document document = new Document();
            PictureWatermark picture = new PictureWatermark();
            picture.Picture = System.Drawing.Image.FromFile(@"..\imagess.jpeg");
            picture.Scaling = 250;
            document.Watermark = picture;
        }
    }
}
[VB.NET]
Imports Spire.Doc
Namespace AddWatermark

	Class Program
		Private Shared Sub Main(args As String())
			Dim document As New Document()
			Dim picture As New PictureWatermark()
			picture.Picture = System.Drawing.Image.FromFile("..\imagess.jpeg")
			picture.Scaling = 250
			document.Watermark = picture
		End Sub
	End Class
End Namespace

Add Text Watermark in Word with C#, VB.NET

This solution is as easy as the solution above. After creating a new instance of Spire.Doc.TextWatermark class which is called txtWatermark, you can set the text which will be shown in Word document. Then, by setting the property TextWatermark.FontSize and TextWatermark.Layout, you can decide the text size and layout of your text watermark. Finally, set the text watermark to be the one you just defined.

[C#]
using Spire.Doc;
using Spire.Doc.Documents;
namespace AddWatermark

{
    class Program
    {
        static void Main(string[] args)
        {
            Document document = new Document();
            TextWatermark txtWatermark = new TextWatermark();
            txtWatermark.Text = "Microsoft";
            txtWatermark.FontSize = 90;
            txtWatermark.Layout = WatermarkLayout.Diagonal;
            document.Watermark = txtWatermark;

        }
    }
}
[VB.NET]
Imports Spire.Doc
Imports Spire.Doc.Documents
Namespace AddWatermark
	Class Program
		Private Shared Sub Main(args As String())
			Dim document As New Document()
			Dim txtWatermark As New TextWatermark()
			txtWatermark.Text = "Microsoft"
			txtWatermark.FontSize = 90
			txtWatermark.Layout = WatermarkLayout.Diagonal
			document.Watermark = txtWatermark

		End Sub
	End Class
End Namespace

Spire.Doc for .NET is specially designed for creating, reading, writing, manipulating Word documents in your .NET applications. With this .NET Word component, you can perform a wide range of tasks directly.