Guide for C#
Core Document Formats
Watermark
Additional Features

C# Word - Create Watermark on Word in C#

How to Add / Insert Watermark on Word Document Using C#.NET Sample Code

Visual C#
Home > .NET Imaging SDK > C# > Create Watermark on Word
If this is your first time to use our DocImageSDK, we strongly suggest you reading How to Start first!

A watermark is a faded, background image which displays behind the text in a document such as a Microsoft Office Word doc. In general, the watermark is used to indicate status of a document, like confidential, draft, approved, or a company logo image.
Related .net document control helps:
asp.net pdf document viewer: ASP.NET PDF Document Viewer in C#: open, display, view, annotate, redact Adobe PDF files online in ASP.NET MVC & WebForm...
asp.net mvc pdf editor: ASP.NET MVC PDF Viewer & Editor: view, annotate, redact, edit PDF document in C# ASP.NET MVC
asp.net document viewer c#: ASP.NET Document Viewer using C#: Open, View, Annotate, Redact, Convert document files in ASP.NET using C#, HTML5, JQuer...
asp.net excel viewer: ASP.NET Excel Viewer in C# Control (MVC & WebForms): view Office Excel document in web browser.
asp.net sharepoint document viewer: ASP.NET SharePoint Document Viewer: view, annotate, redact documents in SharePoint
asp.net pdf editor: EdgePDF: ASP.NET PDF Editor Web Control: Online view, annotate, redact, edit, process, convert PDF documents
asp.net image viewer: ASP.NET Image Viewer Control(MVC & WebForms): view, annotate, redact, convert image files in html, JQuery
RasterEdge DocImage SDK for .NET includes an MS Word Document Processing Add-on, which can effectively integrate watermarking feature into your Word imaging editing application. With this .NET Word library, developers can insert any watermark image into Word document quite easily and accurately.
  • Compatible with Visual C# projects built in Microsoft Visual Studio 2005, 2008 and 2010
  • Detailed Visual C# sample codes provided to add watermark in Word doc
  • Able to control image watermark size, location and layout in C# codes
  • Easy to adjust C# Word text watermark content, font type, font size, and font color, etc
  • Printing watermark on Word in C# Class library and C# windows application
In the following text, we will provide you detailed guidance on how to watermark your Word document in C#.NET class application using our .NET Word document imaging control. Here is the layout of this tutorial page:
  • How to build a C# project for Word processing
  • How to add watermark in MS Word using C# code
  • More C# Word processing user manuals
RasterEdge provides a variety of imaging tutorials to help you make full use of this Word document add-on component, such as how to get started with C# Word document editing - supporting creating, loading and saving Word doc and how to convert C# Word into other formats like images and PDF - supporting png, jpeg, gif, bmp, tiff, svg and PDF.
How to Build a C#.NET Application to Watermark Word
In order to add a watermark in your MS Office Word document using Visual C# programming, you need to build a C# project first before calling this Word processing control DLL. Therefore, this section will guide you to get started with creating a Visual C#.NET class application with the details demonstrated as below.
  1. Make sure you have integrated .NET Framework 2.0 or later, and Microsoft Visual Studio 2005, 2008 or 2010;
  2. Start up your MS Visual Studio, for example 2005 version, and create a C# class application;
  3. Now integrate this .NET Word SDK into your C#.NET project by adding reference to the following two DLLs:
    • RasterEdge.Imaging.Basic.dll
    • RasterEdge.Imaging.MSWordDocx.dll
  4. Define namespace of RasterEdge DocImage SDK for .NET by inputting the C# codings below:
using RasterEdge.Imaging.MSWordDocx;
using RasterEdge.Imaging.Basic.Core;
using RasterEdge.Imaging.Basic;
How to Add Watermark to Word with C# Code
RasterEdge Word processing add-in supports creating user-defined watermark inside the MS Word document by using C# programming language. Currently we support image / picture watermark and text watermark.
This library supports importing local pictures to use as image watermark, with png, jpeg, gif, bmp and tiff image formats supported. Users will also be able to scale the loaded image to get a suitable size for the embed image watermark.
Using this MS Word editing plug-in, developers will also find it so easy to add / insert text watermark in an Office Word doc. We provide flexible options for you to control the text content, text font, size, color (by selecting from the color palette or using RGB value) and watermark layout (horizontal or diagonal).
public static string FolderName = "c:/";

private void button1_Click(object sender, EventArgs e)
{

string fileName1 = FolderName + "Sample1.docx";

string fileName2 = FolderName + "Watermark.png";

REDocument doc1 = REFile.OpenDocumentFile(fileName1, new DOCXDecoder());//use DOCXDecoder open one tif file
REDocument doc2 = REFile.OpenDocumentFile(fileName2, new PNGDecoder());//use PNGDecoder open one tif file


Template doc1 = new Template();

doc1.Elements.Add(doc2);

DocumentFile.Template = doc1;

REFile.SaveDocumentFile(doc, "c:/watermark.docx", new DOCXEncoder());

}
The sample C# code above can help you successfully integrate an image watermark by using your local png picture named "Watermark.png", printing to your MS Word document "Sample1.docx" in .NET class application, and saving the document as a new MS docx doc with a user-defined name "watermark.docx".


Recommend this to Google+


RasterEdge.com is professional provider of ASP.NET MVC Document Viewer, ASP.NET PDF Viewer, MVC PDF Viewer document, content and imaging solutions, available for ASP.NET AJAX, Silverlight, Windows Forms as well as WPF. We are dedicated to provide powerful & profession imaging controls, PDF document, image to pdf files and components for capturing, viewing, processing, converting, compressing and stroing images, documents and more.

©2000-2017 Raster Edge.com