GroupDocs.Parser for Java

Note
groupdocs-parser-java-home Welcome to the GroupDocs.Parser for Java
GroupDocs.Parser is a convenient text extractor API that permits users to extract raw or formatted text from different document formats. Besides, the user can extract metadata from the document.

GroupDocs.Parser for Java

Overview

GroupDocs.Parser for Java is a powerful PDF text extraction library for Java that enables developers to parse and extract information from over 65 document types. This library allows you to extract text from PDF files, Word documents, Excel spreadsheets, and more. You can extract raw or formatted text, metadata, images, tables, and other structured data from various file formats. The library works without requiring additional software installations; OCR of scanned documents is available through an OCR connector that you plug in (see OCR usage).

Key Highlights

  • 65+ document formats - Support for PDF, Office documents, images, archives, and more
  • Template-Based Parsing - Extract structured data using predefined templates
  • Multiple Extraction Modes - Raw text, formatted text, and precise data extraction
  • Enterprise Ready - Scalable solution for high-volume document processing
  • Cross-Platform - Runs on Java 8 or later on Windows, Linux and macOS

What Makes GroupDocs.Parser Unique?

Template-Driven Extraction

One of the most powerful features is parsing documents with predefined templates. Easily define templates to extract specific data from invoices, receipts, contracts, and other structured documents with high precision.

Versatile Text Extraction

  • Raw Text Mode - Fast extraction for basic text processing
  • Formatted Text Mode - Preserve document formatting and structure
  • Search & Highlight - Advanced text search with regex support and keyword highlighting

Comprehensive Data Extraction

  • Extract images and save them in various formats
  • Retrieve document metadata (author, creation date, etc.)
  • Parse tables and maintain their structure
  • Extract attachments from containers and email files
  • Process PDF forms and fillable fields

Installation

Maven

Add the GroupDocs repository and the dependency to your pom.xml:

<repositories>
    <repository>
        <id>GroupDocsJavaAPI</id>
        <name>GroupDocs Java API</name>
        <url>https://releases.groupdocs.com/java/repo/</url>
    </repository>
</repositories>

<dependencies>
    <dependency>
        <groupId>com.groupdocs</groupId>
        <artifactId>groupdocs-parser</artifactId>
        <version>26.10</version>
    </dependency>
</dependencies>

Gradle

repositories {
    mavenCentral()
    maven { url "https://releases.groupdocs.com/java/repo/" }
}

dependencies {
    implementation "com.groupdocs:groupdocs-parser:26.10"
}

Prerequisites

Java: Java 8 (1.8) or later.

For Linux: No native packages are required. Install TrueType fonts (for example, ttf-mscorefonts-installer) if you generate page previews or extract text areas.

See the Installation Guide for detailed setup instructions.

Quick Start Example

Extract text from PDF in Java:

import com.groupdocs.parser.Parser;
import com.groupdocs.parser.data.TextReader;

// Create an instance of Parser class
try (Parser parser = new Parser("sample.pdf")) {
    // Extract text from the document
    try (TextReader reader = parser.getText()) {
        // Check if text extraction is supported
        if (reader != null) {
            // Print the extracted text
            System.out.println(reader.readToEnd());
        } else {
            System.out.println("Text extraction isn't supported for this format");
        }
    }
}

Core Features

Text Extraction

  • Raw and formatted text extraction
  • Page-wise text extraction
  • Text areas extraction with coordinates
  • Search text with advanced options (case sensitivity, whole words, regex)

Metadata & Document Information

  • Extract document properties (title, author, subject, etc.)
  • Retrieve file format information
  • Get page count and document structure
  • Extract custom metadata fields

Image & Media Extraction

  • Extract images from documents
  • Support for multiple image formats (JPEG, PNG, GIF, BMP)
  • Preserve image quality and dimensions
  • Extract images with position information

Structured Data Extraction

  • Parse tables with preserved formatting
  • Extract data using custom templates
  • Process PDF forms and fillable fields
  • Extract hyperlinks and barcodes

Supported Document Formats

CategoryFormats
DocumentsPDF, DOC, DOCX, RTF, TXT, ODT, EPUB
SpreadsheetsXLS, XLSX, ODS, CSV
PresentationsPPT, PPTX, ODP
Emails & ArchivesMSG, EML, PST, OST, ZIP, RAR, TAR
ImagesJPEG, PNG, GIF, BMP, TIFF
Web & MarkupHTML, XHTML, XML
eBooksEPUB, FB2, CHM

View Complete List of Supported Formats →

Use Cases & Applications

Enterprise Document Management

  • Full-Text Search Integration - Build searchable document repositories
  • Content Indexing - Extract and index document content for search engines
  • Document Classification - Categorize documents based on extracted content
  • eDiscovery Solutions - Extract and analyze text from legal documents
  • Contract Analysis - Parse contracts for key terms and clauses
  • Regulatory Compliance - Extract data for compliance reporting

Financial Services

  • Invoice Processing - Parse invoices, receipts, and financial documents
  • Automated Data Entry - Extract structured data from forms
  • Financial Document Analysis - Process statements and reports

Data Migration & Integration

  • Legacy System Migration - Extract content from old document formats
  • System Integration - Parse documents for API integrations
  • Data Transformation - Convert unstructured data to structured formats

Advanced Features

Template-Based Data Extraction

Create custom templates to extract specific data fields:

// Create a template with fixed positions
Template template = new Template(java.util.Arrays.asList(
        new TemplateField(new TemplateFixedPosition(new Rectangle(new Point(35, 135), new Size(100, 10))), "CompanyName"),
        new TemplateField(new TemplateFixedPosition(new Rectangle(new Point(35, 150), new Size(100, 10))), "InvoiceNumber")
));

// Parse document using template
try (Parser parser = new Parser("invoice.pdf")) {
    DocumentData data = parser.parseByTemplate(template);
    // Process extracted data
}

See Working with templates for details.

Batch Processing

Process multiple documents efficiently:

File[] files = new File("C:\\Documents").listFiles(File::isFile);
if (files != null) {
    for (File file : files) {
        try (Parser parser = new Parser(file.getPath())) {
            // Extract and process data from each file
            try (TextReader reader = parser.getText()) {
                if (reader != null) {
                    String content = reader.readToEnd();
                    // Process the content
                }
            }
        } catch (UnsupportedDocumentFormatException ex) {
            // Skip files of unsupported formats
        }
    }
}

Performance & Scalability

  • High Performance - Raw text extraction mode for performance-critical scenarios
  • Memory Efficient - Load documents from an InputStream and read text through a TextReader
  • Scalable Architecture - Handle high-volume document processing
  • On-Premise - Documents never leave your infrastructure (see Network access and data privacy)

Getting Started Resources

Sample Code & Examples

API Reference & Support

Licensing & Trial

System Requirements

  • Java 8 (1.8) or later
  • Operating Systems - Windows, Linux, macOS
  • Build Tools - Maven, Gradle
  • Development Environments - IntelliJ IDEA, Eclipse, NetBeans, VS Code

See System Requirements for details.


GroupDocs.Parser for Java Resources

Following are the links to some useful resources you may need to accomplish your tasks.

Ready to start extracting data from your documents? Download the free trial and begin parsing documents in minutes!

Close
Loading

Analyzing your prompt, please hold on...

An error occurred while retrieving the results. Please refresh the page and try again.

⌂ Proxy