nuxeo/pdfbox-jbig2

Name: pdfbox-jbig2

Owner: Nuxeo

Description: Mirror of Apache PDFBox

Forked from: apache/pdfbox-jbig2

Created: 2018-01-24 18:21:59.0

Updated: 2018-01-24 18:22:02.0

Pushed: 2018-01-24 18:27:24.0

Homepage: null

Size: 1986

Language: Java

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

Welcome to the Java ImageIO plugin for the JBIG2 image format!

The Java ImageIO plugin for JBIG2 enables access to images encoded using the JBIG2 image compression standard. This component is part of the Apache PDFBox® project

Status

Build Status

Features

The key features of the plugin are:

License

This ImageIO plugin is licensed under the Apache Software License 2.0. Alternatively see here.

Release Notes

Please take a look at the release notes.

Support

Support is available through the Apache PDFBox community

Usage
Introduction

Please choose the appropriate section below, depending on whether you need to embed the ImageIO decoder inside your application (which would, for example, be the case if you want to support shared data segments) or you just want to add JBIG2 support to an existing ImageIO-enabled application.

Use within existing Image I/O-based applications

Using the JBIG2 plugin with an existing application that already supports Java ImageIO is - at least in theory - very simple: just plunk the plugin jar down into your classpath and you're ready to go. What, exactly, you have to do to achieve this, depends on the application in question. Unfortunately, there is no general way to add the plugin to an application. Some general recommendations:

Use dependency management

The JBIG2 ImageIO-Plugin is available from Maven Central. :warning: The plugin will be available once we released the first Apache based version.

Maven

To use the plugin within a Maven POM-based project, simply include a dependency to the following artifact in the appropriate `pom.xml`:

<dependency>
  <groupId>org.apache.pdfbox</groupId>
  <artifactId>jbig2-imageio</artifactId>
  <version>3.0.0-SNAPSHOT</version>
</dependency>
How to deal with embedded JBIG2 data

Several formats allow to embed JBIG2-compressed data in its own structure. PDF, for example, supports JBIG2-compressed data and adds the ability to embed shared data segments. Therefore the JBIG2ImageReader can handle JBIG2Globals which are stored separately and can be passed into the reader if neccessary via setGlobals()-method.

The reader recognizes if the input data is headless and so embedded. This is assumed if the file header is missing.

You can also specify that the coming input data is embedded by using the special constructor in JBIG2ImageReader.

What if the plugin is on classpath but not seen?

ImageIO is able to scan the classpath for readers and writers. Call ImageIO.scanForPlugins() if the reader is not seen. (Note: Thanks to George Sexton for this tip in context of using ImageIO within Apache Tomcat)


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.