Watermark move the text in file


I try to watermark a file with this code:

Aspose.Words.Drawing.Shape watermark = new Aspose.Words.Drawing.Shape(doc, Aspose.Words.Drawing.ShapeType.TextPlainText);

// Set up the text of the watermark.
watermark.TextPath.Text = watermarkText;
watermark.TextPath.FontFamily = "Arial";
watermark.Width = 500;
watermark.Height = 20;

watermark.Rotation = 0;
watermark.VerticalAlignment = Aspose.Words.Drawing.VerticalAlignment.Top;
watermark.HorizontalAlignment = Aspose.Words.Drawing.HorizontalAlignment.Center;
watermark.Fill.Color = System.Drawing.Color.Red;
watermark.StrokeColor = System.Drawing.Color.Red;

watermark.RelativeHorizontalPosition = RelativeHorizontalPosition.Page;
watermark.RelativeVerticalPosition = RelativeVerticalPosition.Page;
watermark.WrapType = WrapType.None;

Aspose.Words.Paragraph watermarkPara = new Aspose.Words.Paragraph(doc);

// Insert the watermark into all headers of each document section.
foreach (Aspose.Words.Section sect in doc.Sections)
    // There could be up to three different headers in each section, since we want
    // the watermark to appear on all pages, insert into all headers.
    InsertWatermarkIntoHeader(watermarkPara, sect, HeaderFooterType.HeaderPrimary);
    InsertWatermarkIntoHeader(watermarkPara, sect, HeaderFooterType.HeaderFirst);
    InsertWatermarkIntoHeader(watermarkPara, sect, HeaderFooterType.HeaderEven);

public static void InsertWatermarkIntoHeader(Aspose.Words.Paragraph watermarkPara, Aspose.Words.Section sect, HeaderFooterType headerType)
    Aspose.Words.HeaderFooter header = sect.HeadersFooters[headerType];

    if (header == null)
        // There is no header of the specified type in the current section, create it.
        header = new Aspose.Words.HeaderFooter(sect.Document, headerType);

    // Insert a clone of the watermark into the header.

The watermark is present by it insert a backline so its change the file presentation. See the files attached.

Can you help me??


Hi Laurent,

Thanks for your inquiry. In your case, we suggest you please change the font size of paragraph that contains the watermark to get the desired output. Hope this helps you.

Aspose.Words.Paragraph watermarkPara = new Aspose.Words.Paragraph(doc);
watermarkPara.ParagraphBreakFont.Size = 1;


Thanks for your reply.

Its working.

Have a nice day,



Hi Laurent,

Thanks for your feedback. Please feel free to ask if you have any question about Aspose.Words, we will be happy to help you.