Package org.apache.fop.pdf
Class PDFFormXObject
java.lang.Object
org.apache.fop.pdf.PDFObject
org.apache.fop.pdf.AbstractPDFStream
org.apache.fop.pdf.PDFXObject
org.apache.fop.pdf.PDFFormXObject
- All Implemented Interfaces:
PDFWritable
PDF Form XObject
A derivative of the PDFXObject, is a PDF Stream that has not only a
dictionary but a stream of image data.
-
Field Summary
-
Constructor Summary
ConstructorDescriptionPDFFormXObject
(int xnumber, PDFStream contents, PDFReference resources) create a FormXObject with the given number and name and load the image in the object -
Method Summary
Modifier and TypeMethodDescriptiongetBBox()
Returns the bounding box.Returns the Matrix value.int
output
(OutputStream stream) Overload the base object method so we don't have to copy byte arrays around so much Write the PDF represention of this objectprotected void
Sends the raw stream data to the target OutputStream.protected void
populateStreamDict
(Object lengthEntry) Populates the dictionary with all necessary entries for the stream.void
setBBox
(Rectangle2D bbox) Sets the bounding box of the Form XObject.void
setData
(byte[] data) Used to set the contents of the PDF stream.void
Sets the Matrix valueMethods inherited from class org.apache.fop.pdf.PDFXObject
getName, getSizeHint
Methods inherited from class org.apache.fop.pdf.AbstractPDFStream
encodeAndWriteStream, encodeStream, get, getChildren, getDefaultFilterName, getDictionary, getFilterList, multipleFiltersAllowed, 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
-
PDFFormXObject
create a FormXObject with the given number and name and load the image in the object- Parameters:
xnumber
- the pdf object X numbercontents
- the form's contentsresources
- the resource PDF reference
-
-
Method Details
-
setBBox
Sets the bounding box of the Form XObject.- Parameters:
bbox
- the bounding box
-
getBBox
Returns the bounding box.- Returns:
- the BBox value
-
setMatrix
Sets the Matrix value- Parameters:
at
- the AffineTransform defining the transformation matrix
-
getMatrix
Returns the Matrix value.- Returns:
- the Matrix
-
setData
Used to set the contents of the PDF stream.- Parameters:
data
- the contents as a byte array- Throws:
IOException
- in case of an I/O problem
-
outputRawStreamData
Sends the raw stream data to the target OutputStream.- Specified by:
outputRawStreamData
in classAbstractPDFStream
- Parameters:
out
- OutputStream to write to- Throws:
IOException
- In case of an I/O problem
-
output
Overload the base object method so we don't have to copy byte arrays around so much Write the PDF represention of this object- Overrides:
output
in classAbstractPDFStream
- Parameters:
stream
- the stream to write the PDF to- Returns:
- the number of bytes written
- Throws:
IOException
- if there is an error writing to the stream
-
populateStreamDict
Populates the dictionary with all necessary entries for the stream. Override this method if you need additional entries.- Overrides:
populateStreamDict
in classPDFXObject
- Parameters:
lengthEntry
- value for the /Length entry
-