Free Support Forum - groupdocs.com

Watermark Issue on Word and Excel Document

Hi,
i have applied watermark using text watermark option on word document.
the document has the images inside that, so watermark going behind that images.
i need to bring front on the image.

Code i have used as follows,

using (Watermarker watermarker = new Watermarker(Path.Combine(completePath, document.Location)))
{
TextWatermark watermark = new TextWatermark(watermarkTextJoin, new Font(“Times New Roman”, 15, GroupDocs.Watermark.Watermarks.FontStyle.Bold));
watermark.HorizontalAlignment = GroupDocs.Watermark.Common.HorizontalAlignment.Center;
watermark.VerticalAlignment = GroupDocs.Watermark.Common.VerticalAlignment.Center;
watermark.SizingType = SizingType.ScaleToParentDimensions;
watermark.ForegroundColor = GroupDocs.Watermark.Watermarks.Color.Gray;
watermark.RotateAngle = -45;
watermark.ScaleFactor = 0.7;
watermarker.Add(watermark);

                    watermarker.Save(Path.Combine(Properties.Settings.Default.DocumentStagingFolderPath, "watermark", document.Location));
                }

Watermark Issue word document.png (95.7 KB)

original document as follows,

Document.zip (341.5 KB)

For excel also i have applied the Text Watermark , the same code i used here also.

the watermark is enlarging the row and fitting inside one row as like below image, while loading in viewer.
watermark issue in excel.png (48.0 KB)

@bharathiGK

Please have a look at this thread, we’ve already shared a workaround on this issue. Have a look at this output.zip (380.3 KB) as well. Watermark text is on front of the image.
You can apply same for Excel file. In case issue persists, you’ve to share the problematic Excel file.

Thank you. i will apply and check.

In excel document its applying perfectly. i’m converting that watermark applied document as html pages because i’m using html viewer, in that case converted html will look like the attached images.
Document.zip (177.3 KB)

using (Watermarker watermarker = new Watermarker(Path.Combine(completePath, document.Location)))
{
TextWatermark watermark = new TextWatermark(watermarkTextJoin, new Font(“Times New Roman”, 15, GroupDocs.Watermark.Watermarks.FontStyle.Bold));
watermark.HorizontalAlignment = GroupDocs.Watermark.Common.HorizontalAlignment.Center;
watermark.VerticalAlignment = GroupDocs.Watermark.Common.VerticalAlignment.Center;
watermark.SizingType = SizingType.ScaleToParentDimensions;
watermark.ForegroundColor = GroupDocs.Watermark.Watermarks.Color.Gray;
watermark.RotateAngle = -45;
watermark.ScaleFactor = 0.7;
watermarker.Add(watermark);

                    watermarker.Save(Path.Combine(Properties.Settings.Default.DocumentStagingFolderPath, "watermark", document.Location));
                }

@bharathiGK

Could you please specify/highlight the issue in the converted HTML file? Also share GroupDocs.Viewer for .NET API version that you are using for the rendering process.

Hi,

Groupdocs viewer version - 20.12.0.0.

i have attached original document, watermark applied document, screenshot after loading in viewer and converted html for your reference.

Document.zip (182.1 KB)

Issue 1- while viewing row expansion happens
Issue 2- after converting html watermark not showing as like excel

@bharathiGK

We’ve created a new thread in GroupDocs.Viewer category on your behalf. This query is assisted there. We’d encourage you to always create a new thread for any new issue.