org.apache.fop.pdf

Class PDFImageXObject

Implemented Interfaces:
PDFWritable

public class PDFImageXObject
extends PDFXObject

PDF XObject 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

Fields inherited from class org.apache.fop.pdf.PDFDictionary

entries, order

Fields inherited from class org.apache.fop.pdf.PDFObject

DATE_FORMAT, log

Constructor Summary

PDFImageXObject(int xnumber, PDFImage img)
create an XObject with the given number and name and load the image in the object

Method Summary

protected int
getSizeHint()
protected int
output(OutputStream stream)
Output the image as PDF.
protected void
outputRawStreamData(OutputStream out)
protected void
populateStreamDict(Object lengthEntry)
protected void
prepareImplicitFilters()
protected void
setupFilterList()
This sets up the default filters for XObjects.

Methods inherited from class org.apache.fop.pdf.PDFXObject

getName, getSizeHint, populateStreamDict

Methods inherited from class org.apache.fop.pdf.AbstractPDFStream

encodeAndWriteStream, encodeStream, getFilterList, getSizeHint, output, outputRawStreamData, outputStreamData, populateStreamDict, prepareImplicitFilters, setupFilterList

Methods inherited from class org.apache.fop.pdf.PDFDictionary

get, output, put, put, writeDictionary

Methods inherited from class org.apache.fop.pdf.PDFObject

encode, encodeBinaryToHexString, encodeString, encodeText, formatDateTime, formatDateTime, formatObject, getDocument, getDocumentSafely, getGeneration, getObjectID, getObjectNumber, getParent, hasObjectNumber, makeReference, output, outputInline, referencePDF, setDocument, setObjectNumber, setParent, toPDF, toPDFString

Constructor Details

PDFImageXObject

public PDFImageXObject(int xnumber,
                       PDFImage img)
create an XObject with the given number and name and load the image in the object
Parameters:
xnumber - the pdf object X number
img - the pdf image that contains the image data

Method Details

getSizeHint

protected int getSizeHint()
            throws IOException
Overrides:
getSizeHint in interface PDFXObject

output

protected int output(OutputStream stream)
            throws IOException
Output the image as PDF. This sets up the image dictionary and adds the image data stream.
Overrides:
output in interface AbstractPDFStream
Parameters:
stream - the output stream to write the data
Returns:
the length of the data written

outputRawStreamData

protected void outputRawStreamData(OutputStream out)
            throws IOException
Overrides:
outputRawStreamData in interface AbstractPDFStream

populateStreamDict

protected void populateStreamDict(Object lengthEntry)
Overrides:
populateStreamDict in interface PDFXObject

prepareImplicitFilters

protected void prepareImplicitFilters()
Overrides:
prepareImplicitFilters in interface AbstractPDFStream

setupFilterList

protected void setupFilterList()
This sets up the default filters for XObjects. It uses the PDFImage instance to determine what default filters to apply.
Overrides:
setupFilterList in interface AbstractPDFStream

Copyright 1999-2008 The Apache Software Foundation. All Rights Reserved.