--------------------------
Supported Document Formats
--------------------------
~~ Licensed to the Apache Software Foundation (ASF) under one or more
~~ contributor license agreements. See the NOTICE file distributed with
~~ this work for additional information regarding copyright ownership.
~~ The ASF licenses this file to You under the Apache License, Version 2.0
~~ (the "License"); you may not use this file except in compliance with
~~ the License. You may obtain a copy of the License at
~~
~~ http://www.apache.org/licenses/LICENSE-2.0
~~
~~ Unless required by applicable law or agreed to in writing, software
~~ distributed under the License is distributed on an "AS IS" BASIS,
~~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~~ See the License for the specific language governing permissions and
~~ limitations under the License.
Supported Document Formats
This page lists all the document formats supported by Apache Tika.
* Microsoft's OLE 2 Compound Document format
A number of Microsoft applications, most notably the Microsoft Office
suite, use the generic OLE 2 Compound Document format as the basis of
their document formats. Tika uses {{{http://poi.apache.org/}Apache POI}}
to support a number of these formats.
The OLE2 Compound Document format is designed for use with random access
files, and so the input stream passed to a Tika parser needs to be spooled
in memory or in a temporary file depending on the size of the document.
See {{{https://issues.apache.org/jira/browse/TIKA-153}TIKA-153}} for an
effort to avoid this extra temporary file if the input document already
comes from a file.
In addition to the shared base format there's also a shared sets of
metadata in typical OLE2 documents. Tika uses the
{{{http://poi.apache.org/hpsf/}HPSF library}} from POI to parse these
property sets and exposes them as the following document metadata:
* <<
>> Title
* <<>> Subject
* <<>> Author
* <<>> Keywords
* <<>> Comments
* <<>> Template
* <<>> Last Saved By
* <<>> Revision Number
* <<>> Last Printed
* <<>> Last Saved Time/Date
* <<>> Last Saved Time/Date
* <<>> Number of Pages
* <<>> Number of Words
* <<>> Number of Characters
* <<>> Name of Creating Application
Note that in practice the metadata in many documents is either missing,
incomplete or even incorrect, so a client application should not rely
too much on this information.
Support for the new Office Open XML format used by Microsoft Office
version 2007 is pending for a POI upgrade. Current status is recorded in
{{{https://issues.apache.org/jira/browse/TIKA-152}TIKA-152}}.
The generic OLE2 Compound Document format is automatically detected using
a magic number, and further parsing can automatically determine the more
specific document format. Tika also knows a number of common glob patterns
like <<<*.doc>>> and <<<*.ppt>>> for these formats.
The supported OLE 2 Compound Document formats are:
[Microsoft Excel (application/vnd.ms-excel)]
Excel spreadsheet support is available in all versions of Tika and is
based on the {{{http://poi.apache.org/hssf/}HSSF library}} from POI.
The Excel parser in Tika uses the
{{{http://poi.apache.org/hssf/how-to.html#event_api}HSSF event API}} and
is able to extract much of the document structure, including all
(non-empty) worksheets and their table structures. Formula results are
extracted as stored in the Excel file, and cell links are exposed as
XHTML links. These features were added in Tika version 0.2.
Cell comments and formatting are currently not supported. See
{{{https://issues.apache.org/jira/browse/TIKA-148}TIKA-148}} and
{{{https://issues.apache.org/jira/browse/TIKA-103}TIKA-103}} for the
respective issues.
[Microsoft Word (application/msword)]
Word document support is available in all versions of Tika and is based
on the {{{http://poi.apache.org/hwpf/}HWPF library}} from POI.
The Word parser uses the
{{{http://poi.apache.org/apidocs/org/apache/poi/hwpf/extractor/WordExtractor.html}WordExtractor}}
class from HWPF to extract document content as a sequence of paragraphs.
[Microsoft PowerPoint (application/vnd.ms-powerpoint)]
PowerPoint presentation support is available in all versions of Tika and
is based on the {{{http://poi.apache.org/hslf/}HSLF library}} from POI.
The PowerPoint parser uses the
{{{http://poi.apache.org/apidocs/org/apache/poi/hslf/extractor/PowerPointExtractor.html}PowerPointExtractor}}
class from HSLF to extract spreadsheet content as a single paragraph.
[Microsoft Visio (application/vnd.visio)]
Visio diagram support was added in Tika version 0.2 and is based on the
{{{http://poi.apache.org/hdgf/}HDGF library}} from POI.
The Visio parser uses the
{{{http://poi.apache.org/apidocs/org/apache/poi/hdgf/extractor/VisioTextExtractor.html}VisioExtractor}}
class from HDGF to extract diagram content as a sequence of paragraphs.
[Microsoft Outlook (application/vnd.ms-outlook)]
Outlook message support was added in Tika version 0.2 and is based on the
{{{http://poi.apache.org/hsmf/}HSMF library}} from POI.
The Outlook parser extracts the subject of the message and the From,
To, Cc, and Bcc addresses (formatted for display) along with the body
text of text/plain messages. The <<>>, <<>> and
<<>> metadata properties are set explicitly, overriding
potential generic document metadata retrieved from OLE2 property sets.
* Compression formats
General purpose compression formats are used to reduce the size of
any kinds of documents. Tika uses a parsing pipeline to support general
purpose compression: in the first stage the compressed stream decompressed
and the resulting decompressed stream is passed on to a second parsing
stage where it will be processed as if the document had never been
compressed.
Tika contains magic numbers and glob patterns for auto-detecting all
supported compression formats. The glob patterns of compression formats
are also used to determine the name of the original uncompressed document.
If a client application has supplied a <<>> metadata
property that matches such a glob pattern, then the decompressing first
parsing stage will replace the <<>> metadata property
with the deduced original document name before passing control to the
second parsing stage.
Note that apart from the special handling of the <<>>
property, no document metadata is passed to or from the second parsing
stage. Only the text content extracted by the second stage parser is
returned to the client application.
The supported compression formats are:
[gzip compression (application/x-gzip)]
{{{http://en.wikipedia.org/wiki/Gzip}Gzip}} support was added in
Tika version 0.2 and is based on the
{{{http://java.sun.com/j2se/1.5.0/docs/api/java/util/zip/GZIPInputStream.html}GZIPInputStream}}
class in the Java 5 class library.
The known gzip glob patterns are <<<*.tgz>>>, <<<*.gz>>> and <<<*-gz>>>,
and they will respectively be replaced with <<<*.tar>>>, <<<*>>> and
<<<*>>> as described above.
[bzip2 compression (application/x-bzip)]
{{{http://en.wikipedia.org/wiki/Bzip2}Bzip2}} support was added in
Tika version 0.2 and is based on bzip2 parsing code from
{{{http://ant.apache.org/}Apache Ant}}, which in turn was originally
based on work by Keiron Liddle from Aftex Software.
The known bzip2 glob patterns are <<<*.tbz>>>, <<<*.tbz2>>>, <<<*.bz>>>
and <<<*.bz2>>>, and they will respectively be replaced with <<<*.tar>>>,
<<<*.tar>>>, <<<*>>> and <<<*>>> as described above.
* Audio formats
Tika can detect several common audio formats and extract metadata
from them. Text extraction is supported for some MIDI-based karaoke
formats that contain the lyrics of the encoded audio.
See {{{https://issues.apache.org/jira/browse/TIKA-94}TIKA-94}} for
an effort to integrate speech recognition support to Tika.
[MP3 Audio (audio/mpeg)]
The parsing of {{{http://www.id3.org/ID3v1}ID3v1}} tags from MP3 files
was added in Tika version 0.2. If found the following metadata is
extracted and set:
* <<>> Title
* <<>> Subject
The above information, as well as the <<>>, <<