The property indicating whether the watermark size and coordinates are calculated considering parent margins. If set to True, calculations consider parent margins; by default the value is False and parent margins are ignored. (inherited from Watermark)
The property indicating whether the watermark should be placed in the background. If true, the watermark is placed at the bottom; otherwise, it is placed at the top (default is False). (inherited from Watermark)
importiofromgroupdocs.watermarkimportWatermarkerfromgroupdocs.watermark.watermarksimportImageWatermarkdefadd_image_watermark_from_stream():# Load image data into a streamwithopen("./logo.png","rb")asf:image_data=f.read()# Open the document and add the image watermarkwithWatermarker("./sample.docx")aswatermarker:withImageWatermark(stream=io.BytesIO(image_data))aswatermark:watermarker.add(watermark)watermarker.save("./output.docx")