How to print watermark in Excel in the footer using Aspose Cells API for Java

Hi
I was trying to print watermark in Excel in the footer using Aspose Cells API for Java ,using this code

PageSetup pageSetup = sheet.getPageSetup();
pageSetup.setFooter(2, watermarkText);

But the issue it overlaps with existing message in footer.

Can you suggest a solution for this?

@sabkan,

If there is some text/message in the right side of the footer (worksheet page(s)), surely, it will be overwritten. You may test your scenario/case in MS Excel manually and you will get similar results. In case you find MS Excel does it differently, kindly do provide sample Excel file and complete sample code to reproduce the issue. We will check it soon. Also, provide a sample Excel file containing your desired footer texts/messages in your desired order.

PS. please zip the resource files prior attaching here.

@amjad.sahi

Thanks for the reply. Is it possible to make the watermark appear in background or transparent in the footer so that doesnt look overwriting?

@sabkan,

Aspose.Cells follows MS Excel standards, so if MS Excel supports this feature, you can also achieve it using Aspose.Cells. However, I do not believe this feature is supported in MS Excel. Please correct me if I am wrong and provide a sample Excel file containing a watermark appearing in the background or transparent in the footer. You can create your desired Excel file in MS Excel and then provide it to us. We will then investigate how to implement it using the Aspose.Cells API.

@amjad.sahi
ok.Earlier we had tried using this code snippet,so that looked like transparent or so,but the issue was it coming in the body and not in footer,


// FontSetting fontSetting = pageSetup.getFooterFont(2); // 2 is the section where you added the watermark
// fontSetting…setSize(12); // Set the font size
// fontSetting.setBold(true); // Make the text bold
// fontSetting.setColor(Color.getRed()); // Set the font color to red
// Add watermark
// Shape wordart = sheet.getShapes().addTextEffect(MsoPresetTextEffect.TEXT_EFFECT_1, watermarkText,
// “Arial”, 50, false, true, 18, 8, 1, 1, 130, 800);


Then you had suggested this approach.

pageSetup.setFooter(2, watermarkText);

@sabkan,

Alright, so you were trying to set the wordart watermark (pasted in the body of the worksheet page) to appear in footer area. Anyways, should you have further queries, please feel free to write us back with details.

@amjad.sahi

initially used wordart watermark ,but it was appearing in the body.But we wanted the watermark in the footer.Right if it is possible to have the wordart like watermark or through some mechanism(which appears in backround or transparent),in the footer it will be nice.

@sabkan
It seems that Excel itself cannot achieve similar functionality, so unfortunately, we may not be able to support it at the moment. We will further investigate this issue. Thank you!

@sabkan
MS Excel only can insert pictures into header/footer.
Please check the document about inserting pictures into header/footer with Aspose.Cells: