-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
164 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,156 @@ | ||
--- | ||
title: Watermark XLSX document via Java | ||
weight: 7680 | ||
|
||
description: Java sample code to add or remove watermark to XLSX file on Java Runtime Environment for JSP/JSF Application and Desktop Applications. | ||
keywords: [Java Aspose.Cells., Java add watermark to XLSX file., Java insert watermark to XLSX file., Java create watermark in XLSX file., remove watermark from XLSX file using Java., Java operate watermark in XLSX file., Java access watermark in XLSX file] | ||
--- | ||
|
||
|
||
{{< blocks/products/pf/main-wrap-class isAutogenPage="true">}} | ||
{{< blocks/products/pf/upper-banner h1="Add Text Watermark to XLSX via Java" h2="Build your own Java apps to watermark XLSX files using server-side APIs." logoImageSrc="https://www.aspose.cloud/templates/aspose/img/products/cells/aspose_cells-for-java.svg" sourceAdditionalConversionTag="" additionalConversionTag="XLSX" pfName="Aspose.Cells" subTitlepfName="for Java" downloadUrl="" fileiconsmall1="PPTX" fileiconsmall2="DOCX" fileiconsmall3="XLSX" fileiconsmall4="PDF" fileiconsmall5=" ODP " >}} | ||
|
||
{{< blocks/products/pf/main-container pfName="Aspose.Cells " subTitlepfName="for Java" >}} | ||
{{< blocks/products/pf/sub-menu autoGeneratedVersion="true" logoImageSrc="https://www.aspose.cloud/templates/aspose/img/products/cells/aspose_cells-for-java.svg" apiHomeLink="" codeSamplesLink="https://github.com/aspose-cells" liveDemosLink="https://products.aspose.app/cells/family" docsLink="https://docs.aspose.com/cells/java" installationsDocsLink="https://docs.aspose.com/cells/java" nugetLink="" nugetPackageName="" downloadAsLink="https://downloads.aspose.com/cells/java" learnAsLink="https://docs.aspose.com/cells/java" apiReference="" mavenRepoLink="https://repository.aspose.com/webapp/#/artifacts/browse/tree/General/repo/com/aspose/aspose-cells" >}} | ||
|
||
{{% blocks/products/pf/agp/content h2="How to Watermark XLSX File Using Java" %}} | ||
|
||
In order to watermark XLSX file, we’ll use [Aspose.Cells for Java](https://products.aspose.com/cells/java) API which is a feature-rich, powerful and easy to use watermarking API for Java platform. You can download its latest version directly from [Maven](https://repository.aspose.com/webapp/#/artifacts/browse/tree/General/repo/com/aspose/aspose-cells) and install it within your Maven-based project by adding the following configurations to the pom.xml. | ||
|
||
{{% blocks/products/pf/agp/code-block title="Repository" offSpacer="true" %}} | ||
|
||
```cs | ||
|
||
<repository> | ||
<id>AsposeJavaAPI</id> | ||
<name>Aspose Java API</name> | ||
<url>https://repository.aspose.com/repo/</url> | ||
</repository> | ||
|
||
``` | ||
|
||
{{% /blocks/products/pf/agp/code-block %}} | ||
|
||
{{% blocks/products/pf/agp/code-block title="Dependency" offSpacer="true" %}} | ||
|
||
```cs | ||
<dependency> | ||
<groupId>com.aspose</groupId> | ||
<artifactId>aspose-cells</artifactId> | ||
<version>version of aspose-cells API</version> | ||
<classifier>jdk17</classifier> | ||
</dependency> | ||
|
||
``` | ||
|
||
{{% /blocks/products/pf/agp/code-block %}} | ||
|
||
{{% /blocks/products/pf/agp/content %}} | ||
|
||
{{< blocks/products/pf/agp/feature-section isGrey="true" >}} | ||
|
||
{{% blocks/products/pf/agp/feature-section-col title="Steps to Add Watermark to XLSX via Java" %}} | ||
|
||
{{% blocks/products/pf/agp/text %}} | ||
|
||
{{% /blocks/products/pf/agp/text %}} | ||
|
||
1. Create a new Workbook object | ||
1. Select Worksheet via its index | ||
1. Create a Shape and use its addTextEffect function | ||
1. Set colors, Transparency and more | ||
1. Save workbook in XLSX format | ||
|
||
{{% /blocks/products/pf/agp/feature-section-col %}} | ||
|
||
{{% blocks/products/pf/agp/feature-section-col title="System Requirements" %}} | ||
|
||
{{% blocks/products/pf/agp/text %}} | ||
|
||
Aspose.Cells for Java supports on all major platforms and Operating Systems. Please make sure that you have the following prerequisites. | ||
|
||
{{% /blocks/products/pf/agp/text %}} | ||
|
||
- Microsoft Windows or a compatible OS with Java Runtime Environment for JSP/JSF Application and Desktop Applications. | ||
- Get latest version of Aspose.Cells for Java directly from Maven. | ||
|
||
{{% /blocks/products/pf/agp/feature-section-col %}} | ||
|
||
{{% blocks/products/pf/agp/code-block title="Add Watermark to XLSX - Java" offSpacer="" %}} | ||
|
||
```cs | ||
|
||
// Instantiate a new Workbook | ||
Workbook workbook = new Workbook(); | ||
|
||
// Get the first default sheet | ||
Worksheet sheet = workbook.getWorksheets().get(0); | ||
|
||
// Add Watermark | ||
Shape wordart = sheet.getShapes().addTextEffect(MsoPresetTextEffect.TEXT_EFFECT_1, "CONFIDENTIAL", | ||
"Arial Black", 50, false, true, 18, 8, 1, 1, 130, 800); | ||
|
||
// Get the fill format of the word art | ||
FillFormat wordArtFormat = wordart.getFill(); | ||
|
||
// Set the color | ||
wordArtFormat.setOneColorGradient(Color.getRed(), 0.2, GradientStyleType.HORIZONTAL, 2); | ||
|
||
// Set the transparency | ||
wordArtFormat.setTransparency(0.9); | ||
|
||
// Make the line invisible | ||
LineFormat lineFormat = wordart.getLine(); | ||
lineFormat.setWeight(0.0); | ||
|
||
// Save the file | ||
workbook.save(dataDir + "AWArtWToWorksheet_out.xlsx"); | ||
|
||
``` | ||
|
||
{{% /blocks/products/pf/agp/code-block %}} | ||
|
||
{{< /blocks/products/pf/agp/feature-section >}} | ||
|
||
{{< blocks/products/pf/agp/faq-item question="" answer="" >}} | ||
|
||
|
||
<!-- aboutfile Starts --> | ||
|
||
{{% blocks/products/pf/agp/content h2="About Aspose.Cells for Java API" %}} | ||
|
||
Aspose.Cells API can be used to create, edit, convert and render Microsoft Excel formats to different formats. Moreover, it can be used for comprehensive charting, scalable reporting and reliable calculations within software applications. Aspose.Cells is a standalone API and it does not require any software like Microsoft or OpenOffice. | ||
|
||
|
||
|
||
{{% /blocks/products/pf/agp/content %}} | ||
|
||
{{< blocks/products/pf/agp/about-file-section >}} | ||
|
||
{{< blocks/products/pf/agp/demobox sectionTitle="Watermark XLSX via Online App" sectionDescription="Add watermark to XLSX documents by visiting our [Live Demos website](https://products.aspose.app/cells/watermark). The live demo has the following benefits" >}} | ||
{{< blocks/products/pf/agp/democard icon="fa-cogs" text=" No need to download or setup anything" >}} | ||
{{< blocks/products/pf/agp/democard icon="fa-edit" text=" No need to write any code" >}} | ||
{{< blocks/products/pf/agp/democard icon="fa-file-text" text="Just upload your XLSX file, set your watermark and hit \"Add\" button" >}} | ||
{{< blocks/products/pf/agp/democard icon="fa-download" text=" Instantly get the download link for the resultant file" >}} | ||
|
||
{{< blocks/products/pf/agp/about-file-text fileFormat="XLSX" readMoreLink="https://docs.fileformat.com/spreadsheet/xlsx/" >}} | ||
XLSX is well-known format for Microsoft Excel documents that was introduced by Microsoft with the release of Microsoft Office 2007. Based on structure organized according to the Open Packaging Conventions as outlined in Part 2 of the OOXML standard ECMA-376, the new format is a zip package that contains a number of XML files. The underlying structure and files can be examined by simply unzipping the .xlsx file. | ||
|
||
{{< /blocks/products/pf/agp/about-file-text >}} | ||
|
||
{{< /blocks/products/pf/agp/about-file-section >}} | ||
|
||
<!-- aboutfile Ends --> | ||
|
||
{{< blocks/products/pf/agp/other-supported-section title="Other Supported Watermarking Formats" subTitle="Using Java, one can easily watermark different formats including." >}} | ||
|
||
{{< blocks/products/pf/agp/other-supported-section-item href="https://products.aspose.com/cells/java/watermark/ods/" name="ODS" description="OpenDocument Spreadsheet File" >}} | ||
{{< blocks/products/pf/agp/other-supported-section-item href="https://products.aspose.com/cells/java/watermark/xls/" name="XLS" description="Excel Binary Format" >}} | ||
{{< blocks/products/pf/agp/other-supported-section-item href="https://products.aspose.com/cells/java/watermark/xlsb/" name="XLSB" description="Binary Excel Workbook File" >}} | ||
{{< blocks/products/pf/agp/other-supported-section-item href="https://products.aspose.com/cells/java/watermark/xlsm/" name="XLSM" description="Spreadsheet File" >}} | ||
|
||
{{< /blocks/products/pf/agp/other-supported-section >}} | ||
|
||
{{< /blocks/products/pf/main-container >}} | ||
|
||
{{< /blocks/products/pf/main-wrap-class >}} |