public class OffsetPDFFormat extends PDFFormat
A PDF processor may encounter PDF 2.0 files that contain information before the actual PDF 2.0 data.
For a specific workflow or use cases, PDF-2.0 allows a PDF producer to write any data into a PDF file in addition to and before the actual PDF data. This behaviour is explicitly not recommended, but it is not negated either.
OffsetPDFFormat is an extension of PDFFormat. Its task is to recognise PDF2.0 documents with leading offset and to load them as PDF.
Modifier and Type | Field and Description |
---|---|
static int |
DEFAULT_OFFSET_SIZE |
static int |
MAX_OFFSET_SIZE |
static String |
OFFSET_SIZE_PROPERTY |
BASE_FORMAT_VERSION, DEFAULT_PRIORITY, MAX_PRIORITY, MIN_PRIORITY
Constructor and Description |
---|
OffsetPDFFormat() |
Modifier and Type | Method and Description |
---|---|
FormatReader |
createReader()
Instantiate a new
FormatReader for this format. |
String |
getDescription()
Describes the format represented by this instance.
|
int |
getOffsetBufferSize() |
int |
getPriority()
Return the priority with which this format will be selected, if there are multiple eligible ones.
|
boolean |
matches(SeekableInputStream stream)
Within the read process this method is called to auto-determine the format of the data passed.
|
void |
setOffsetBufferSize(int offset) |
getDefaultExtensions, getMimeType, getName, getVersion
canRead, canWrite, create, createWriter, equals, hashCode, isSecondary, isSupported, toString
public static final int MAX_OFFSET_SIZE
public static final int DEFAULT_OFFSET_SIZE
public static String OFFSET_SIZE_PROPERTY
public int getOffsetBufferSize()
public void setOffsetBufferSize(int offset)
public String getDescription()
Format
getDescription
in class PDFFormat
public int getPriority()
Format
getPriority
in class Format
Format.MIN_PRIORITY
,
Format.DEFAULT_PRIORITY
,
Format.MAX_PRIORITY
public boolean matches(SeekableInputStream stream) throws IOException
Format
matches
in class PDFFormat
stream
- contains the data to be tested.IOException
- if an io error occurspublic FormatReader createReader()
Format
FormatReader
for this format.createReader
in class PDFFormat
FormatReader
for this formatCopyright © 2024 levigo holding gmbh. All rights reserved.