This project has moved. For the latest updates, please go here.

Add a watermark

Apr 6, 2016 at 4:27 PM
i am trying to add a watermark however i wasnt able, i thought of adding an image with rotation however i don't know how to,
a. set image text wrap to be behind text
b. fix image location

please help me to do so

thanks in advance
Apr 6, 2016 at 4:30 PM
Not sure what watermark means in your case bun in Examples you have this code. It adds 2 images. One normal way, one with rotation.
   /// <summary>
    /// Create a document with two pictures. One picture is inserted normal way, the other one with rotation
    /// </summary>
static void HelloWorldAddPictureToWord() {

// Create a document.
using (DocX document = DocX.Create(@"docs\HelloWorldAddPictureToWord.docx"))
    // Add an image into the document.    
    RelativeDirectory rd = new RelativeDirectory(); // prepares the files for testing
    Image image = document.AddImage(rd.Path + @"\images\logo_template.png");

    // Create a picture (A custom view of an Image).
    Picture picture = image.CreatePicture();
    picture.Rotation = 10;

    // Insert a new Paragraph into the document.
    Paragraph title = document.InsertParagraph().Append("This is a test for a picture").FontSize(20).Font(new FontFamily("Comic Sans MS"));
    title.Alignment =;

    // Insert a new Paragraph into the document.
    Paragraph p1 = document.InsertParagraph();

    // Append content to the Paragraph
    p1.AppendLine("Just below there should be a picture ").Append("picture").Bold().Append(" inserted in a non-conventional way.");
    p1.AppendLine("Check out this picture ").AppendPicture(picture).Append(" its funky don't you think?");

    // Insert a new Paragraph into the document.
    Paragraph p2 = document.InsertParagraph();
    // Append content to the Paragraph.

    p2.AppendLine("Is it correct?");

    // Lets add another picture (without the fancy stuff)
    Picture pictureNormal = image.CreatePicture();

    Paragraph p3 = document.InsertParagraph();
    p3.AppendLine("Lets add another picture (without the fancy  rotation stuff)");

    // Save this document.
    Console.WriteLine("\tCreated: docs\\HelloWorldAddPictureToWord.docx\n");