We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Watermark

Hi!
I am facing an issue while adding watermark.
i have to add different watermark whenever a document is accessed. Adding these lines of code include a header everytime addwatermark function is called due to which document content slide lower everytime. so calling add watermark function multiple times make the document actual content disappear.
if (header == null)
{
// There is no header of the specified type in the current section, create it.
header = new HeaderFooter(sect.getDocument(), headerType);
sect.getHeadersFooters().add(header);
}
kindly suggest possible solution in which we don’t have to add extra header on every document page.

Regards
Saima

Hi Saima,


Thanks for your inquiry. Could you please attach your input and expected output Word documents here for our reference? We will then provide you more information about your query along with code.

Hi!
Actual Document and expected output is attached as desired. watermark1 and watermark2 attachments are the output of the code which is available for adding watermark using aspose. These attachments clearly shows addition of space on the start of document body everytime when already added watermark is removed and a new watermark is inserted in the same document.
kindly suggest possible solution.

Regards
Saima

Hi Saima,


Thanks for sharing the documents.
Saima:
i have to add different watermark whenever a document is accessed. Adding these lines of code include a header everytime addwatermark function is called due to which document content slide lower everytime. so calling add watermark function multiple times make the document actual content disappear.

These attachments clearly shows addition of space on the start of document body everytime when already added watermark is removed and a new watermark is inserted in the same document.
The watermark in the Expectedoutput.docx and watermark1.docx is not same. It would be great if you please share following detail for investigation purposes.

  • Please attach your expected output document with watermark "Viewed At : 12-22-2015 "
  • Please share which contents are disappear in output Word document
  • Please share some detail about your query "addition of space on the start of document body every time"
  • Please create a standalone Java application (source code without compilation errors) that helps us reproduce your problem on our end and attach it here for testing.

As soon as you get these pieces of information to us we’ll start our investigation into your issue.