-
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
159 additions
and
32 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,147 @@ | ||
--- | ||
title: Extract text and images from XLSX document via Java | ||
weight: 3260 | ||
|
||
description: Java sample code to extract text and images from XLSX file on Java Runtime Environment for JSP/JSF Application and Desktop Applications. | ||
keywords: [Java Aspose.Cells., Java Extract text and images from XLSX file., Java How to Parse XLSX File., Java Extract text from XLSX file., Extract images from XLSX file using Java] | ||
--- | ||
|
||
{{< blocks/products/pf/main-wrap-class isAutogenPage="true">}} | ||
{{< blocks/products/pf/upper-banner h1="Parse XLSX Formats in Java" h2="Native and high performance XLSX document parsing using server-side Aspose.Cells for Java APIs, without the use of any software like Microsoft or Adobe PDF." logoImageSrc="https://www.aspose.cloud/templates/aspose/img/products/cells/aspose_cells-for-java.svg" sourceAdditionalConversionTag="" additionalConversionTag="" pfName="Aspose.Cells" subTitlepfName="for Java" downloadUrl="" fileiconsmall1="PNG" fileiconsmall2="JPG" fileiconsmall3="BMP" fileiconsmall4="TIFF" fileiconsmall5="XLSX" >}} | ||
|
||
{{< 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="https://www.nuget.org/packages/aspose.cells" 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 Parse XLSX File Using Java" %}} | ||
|
||
In order to parse 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 parsing 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 Parse XLSX Files in Java" %}} | ||
|
||
{{% blocks/products/pf/agp/text %}} | ||
|
||
A basic document parsing with [Aspose.Cells for Java](https://products.aspose.com/cells/java) APIs can be done with just few lines of code. Parse text & images from Microsoft Excel XLS, XLSX, XLSM, XLSB and OpenDocument ODS files. | ||
|
||
{{% /blocks/products/pf/agp/text %}} | ||
|
||
+ Load XLSX document using Workbook class. | ||
+ Select the requied sheet using getWorksheets().get method. | ||
+ Get all cells of the selected sheet using getCells(). | ||
+ Iterate over each cell, get its text . | ||
+ Print each cell value or Use StringBuilder append() method to view as a whole | ||
|
||
{{% /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](https://repository.aspose.com/webapp/#/artifacts/browse/tree/General/repo/com/aspose/aspose-cells) . | ||
|
||
{{% /blocks/products/pf/agp/feature-section-col %}} | ||
|
||
{{% blocks/products/pf/agp/code-block title="Parse XLSX Files - Java" offSpacer="" %}} | ||
|
||
```cs | ||
StringBuilder stringBuilder = new StringBuilder(); | ||
Workbook book = new Workbook(dir + "book1.xlsx"); | ||
Worksheet sheet = book.getWorksheets().get(0); | ||
Cells cells = sheet.getCells(); | ||
Iterator iterator = cells.iterator(); | ||
while(iterator.hasNext()) | ||
{ | ||
Cell cell = (Cell)iterator.next(); | ||
stringBuilder.append(cell.getStringValue()); | ||
stringBuilder.append(" "); | ||
} | ||
System.out.println(stringBuilder.toString()); | ||
|
||
|
||
|
||
``` | ||
|
||
{{% /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="Online XLSX Parser Live Demos" sectionDescription="Extract text and images from XLSX documents right now by visiting our [Live Demos website](https://products.aspose.app/cells/parser). The live demo has the following benefits" >}} | ||
{{< blocks/products/pf/agp/democard icon="fa-cogs" text=" No need to download Aspose API." >}} | ||
{{< 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 files." >}} | ||
{{< blocks/products/pf/agp/democard icon="fa-download" text=" It will be parsed instantly." >}} | ||
{{< /blocks/products/pf/agp/demobox >}} | ||
|
||
{{< 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 Parsing Documents" subTitle="Using Java, one can easily parse other formats including." >}} | ||
|
||
{{< blocks/products/pf/agp/other-supported-section-item href="https://products.aspose.com/cells/java/parser/ods/" name="ODS" description="OpenDocument Spreadsheet File" >}} | ||
{{< blocks/products/pf/agp/other-supported-section-item href="https://products.aspose.com/cells/java/parser/xls/" name="XLS" description="Excel Binary Format" >}} | ||
{{< blocks/products/pf/agp/other-supported-section-item href="https://products.aspose.com/cells/java/parser/xlsb/" name="XLSB" description="Binary Excel Workbook File" >}} | ||
{{< blocks/products/pf/agp/other-supported-section-item href="https://products.aspose.com/cells/java/parser/xlsm/" name="XLSM" description="Spreadsheet File" >}} | ||
|
||
{{< /blocks/products/pf/agp/other-supported-section >}} | ||
|
||
{{< /blocks/products/pf/main-container >}} | ||
|
||
{{< /blocks/products/pf/main-wrap-class >}} |