org.apache.fop.pdf
Class PDFStream

org.apache.fop.pdf.PDFObject
  |
  +--org.apache.fop.pdf.PDFStream

public class PDFStream
extends PDFObject

class representing a PDF stream. A derivative of the PDF Object, a PDF Stream has not only a dictionary but a stream of PDF commands. The stream of commands is where the real work is done, the dictionary just provides information like the stream length.


Constructor Summary
PDFStream(int number)
          create an empty stream object

Method Summary
 voidadd(String s)
          append data to the stream
 voidaddFilter(PDFFilter filter)
          Add a filter for compression of the stream.
 voidaddFilter(String filterType)
           
 voidaddImageArray(int[] pixels, int width, int height)
          append an array of xRGB pixels, ASCII Hex Encoding it first
 byte[]getData()
           
 intgetDataLength()
           
 voidsetData(byte[] data)
           
 byte[]toPDF()
          represent as PDF.

Methods inherited from class org.apache.fop.pdf.PDFObject
getNumber, referencePDF

Constructor Detail

PDFStream

public PDFStream(int number)
create an empty stream object
Parameters:
number - the object's number
Method Detail

add

public void add(String s)
append data to the stream
Parameters:
s - the string of PDF to add

addFilter

public void addFilter(PDFFilter filter)
Add a filter for compression of the stream. Filters are applied in the order they are added. This should always be a new instance of the particular filter of choice. The applied flag in the filter is marked true after it has been applied to the data.

addFilter

public void addFilter(String filterType)

addImageArray

public void addImageArray(int[] pixels, int width, int height)
append an array of xRGB pixels, ASCII Hex Encoding it first
Parameters:
pixels - the area of pixels
width - the width of the image in pixels
height - the height of the image in pixels

getData

public byte[] getData()

getDataLength

public int getDataLength()

setData

public void setData(byte[] data)
throws java.io.IOException

toPDF

public byte[] toPDF()
represent as PDF.
Returns: the PDF string.

Association Links

to Class java.io.ByteArrayOutputStream

the stream of PDF commands

to Class java.util.Vector

the filters that should be applied