How to include Watermark on a copied template

I am using the service manager and desktop to create a document from a template (.ott), manipulate the contents in code and then save the completed document. I want to be able to produce a draft version and was trying to use a template with a watermark in place to mark if the document was a draft rather than finished. However, the watermark does not show on the copied and manipulated document, the only evidence of it being the several hidden instances of PowerPlusWaterMarkObject in the document drawing objects. Is this a bug or am I missing something?

Apologies, I come refreshed to the code and find I was overwriting the template with the watermark with the one without it and missed that in the chaos of commented out code. I resorted to two templates having failed to find a way in code to change/remove the watermark. I will settle for maintaining two templates.

Thank you for your answers.

Service manager ???

Please edit your question to describe your procedure. Are you trying to script drive Writer? Don’t forget to mention your OS and LO version.

Apologies, I come refreshed to the code and find I was overwriting the template with the watermark with the one without it before manipulating the document further. Thank you for your answers.

This is not a solution to the problem. Rules for this site state that feed back (and thanks are highly appreciated) go into a comment. Please use your more link in this “answer” to repost as a comment.

Eventually, edit this answer to make clear it was a user error and close the question with reason “no longer relevant or outdated”. This will be a real answer/conclusion.

Hello

Was the template made with MS Word and saved under .doc or .docx format as several PowerPlusWaterMarkObject are present ?

To avoid troubles, work with LO only with documents inder OpenDocument Format, like .odt. This will avoid many conflicts.

So, if it is the case, start a new template, bases on a text copy of the old template, reshape the new template with watermark and save it as a template.

To bring comments or info, please edit your question description : do not use an answer unless you provide a real answer.

Kind regards, Michel