Package org.apache.fop.pdf
Class PDFXObject
java.lang.Object
org.apache.fop.pdf.PDFObject
org.apache.fop.pdf.AbstractPDFStream
org.apache.fop.pdf.PDFXObject
- All Implemented Interfaces:
PDFWritable
- Direct Known Subclasses:
PDFFormXObject
,PDFImageXObject
Abstract base class of PDF XObjects.
A derivative of the PDF Object, is a PDF Stream that has not only a
dictionary but a stream of image data.
The dictionary just provides information like the stream length.
This outputs the image dictionary and the image data.
This is used as a reference for inserting the same image in the
document in another place.
-
Field Summary
-
Constructor Summary
ModifierConstructorDescriptionCreate an XObject with the given number.protected
PDFXObject
(PDFDictionary dictionary) -
Method Summary
Modifier and TypeMethodDescriptiongetName()
Returns the XObject's name.protected int
Returns a value that hints at the size of the encoded stream.protected void
populateStreamDict
(Object lengthEntry) Populates the dictionary with all necessary entries for the stream.Methods inherited from class org.apache.fop.pdf.AbstractPDFStream
encodeAndWriteStream, encodeStream, get, getChildren, getDefaultFilterName, getDictionary, getFilterList, multipleFiltersAllowed, output, outputRawStreamData, outputStreamData, prepareImplicitFilters, put, registerChildren, setDocument, setupFilterList
Methods inherited from class org.apache.fop.pdf.PDFObject
contentEquals, encode, encodeBinaryToHexString, encodeString, encodeText, formatObject, getDocument, getDocumentSafely, getGeneration, getObjectID, getObjectNumber, getParent, hasObjectNumber, makeReference, outputInline, referencePDF, setObjectNumber, setObjectNumber, setObjectNumber, setParent, toPDF, toPDFString
-
Constructor Details
-
PDFXObject
public PDFXObject()Create an XObject with the given number. -
PDFXObject
-
-
Method Details
-
getName
Returns the XObject's name.- Returns:
- the name of the XObject
-
populateStreamDict
Populates the dictionary with all necessary entries for the stream. Override this method if you need additional entries.- Overrides:
populateStreamDict
in classAbstractPDFStream
- Parameters:
lengthEntry
- value for the /Length entry
-
getSizeHint
Returns a value that hints at the size of the encoded stream. This is used to optimize buffer allocation so fewer buffer reallocations are necessary.- Specified by:
getSizeHint
in classAbstractPDFStream
- Returns:
- an estimated size (0 if no hint can be given)
- Throws:
IOException
- in case of an I/O problem
-