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
ConstructorsConstructorDescriptionPDFFormXObject(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.intoutput(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 voidSends the raw stream data to the target OutputStream.protected voidpopulateStreamDict(Object lengthEntry) Populates the dictionary with all necessary entries for the stream.voidsetBBox(Rectangle2D bbox) Sets the bounding box of the Form XObject.voidsetData(byte[] data) Used to set the contents of the PDF stream.voidSets the Matrix valueMethods inherited from class org.apache.fop.pdf.PDFXObject
getName, getSizeHintMethods inherited from class org.apache.fop.pdf.AbstractPDFStream
encodeAndWriteStream, encodeStream, get, getChildren, getDefaultFilterName, getDictionary, getFilterList, multipleFiltersAllowed, outputStreamData, prepareImplicitFilters, put, registerChildren, setDocument, setupFilterListMethods 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:
outputRawStreamDatain 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:
outputin 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:
populateStreamDictin classPDFXObject- Parameters:
lengthEntry- value for the /Length entry
-