com.lowagie.text.pdf

Class PRStream

public class PRStream extends PdfStream

Field Summary
protected intlength
protected intobjGen
protected intobjNum
protected intoffset
protected PdfReaderreader
Constructor Summary
PRStream(PRStream stream, PdfDictionary newDic)
PRStream(PRStream stream, PdfDictionary newDic, PdfReader reader)
PRStream(PdfReader reader, int offset)
PRStream(PdfReader reader, byte[] conts)
PRStream(PdfReader reader, byte[] conts, int compressionLevel)
Creates a new PDF stream object that will replace a stream in a existing PDF file.
Method Summary
byte[]getBytes()
intgetLength()
intgetObjGen()
intgetObjNum()
intgetOffset()
PdfReadergetReader()
voidsetData(byte[] data, boolean compress)
Sets the data associated with the stream, either compressed or uncompressed.
voidsetData(byte[] data, boolean compress, int compressionLevel)
Sets the data associated with the stream, either compressed or uncompressed.
voidsetData(byte[] data)
Sets the data associated with the stream
voidsetLength(int length)
voidsetObjNum(int objNum, int objGen)
voidtoPdf(PdfWriter writer, OutputStream os)

Field Detail

length

protected int length

objGen

protected int objGen

objNum

protected int objNum

offset

protected int offset

reader

protected PdfReader reader

Constructor Detail

PRStream

public PRStream(PRStream stream, PdfDictionary newDic)

PRStream

public PRStream(PRStream stream, PdfDictionary newDic, PdfReader reader)

PRStream

public PRStream(PdfReader reader, int offset)

PRStream

public PRStream(PdfReader reader, byte[] conts)

PRStream

public PRStream(PdfReader reader, byte[] conts, int compressionLevel)
Creates a new PDF stream object that will replace a stream in a existing PDF file.

Parameters: reader the reader that holds the existing PDF conts the new content compressionLevel the compression level for the content

Since: 2.1.3 (replacing the existing constructor without param compressionLevel)

Method Detail

getBytes

public byte[] getBytes()

getLength

public int getLength()

getObjGen

int getObjGen()

getObjNum

int getObjNum()

getOffset

public int getOffset()

getReader

public PdfReader getReader()

setData

public void setData(byte[] data, boolean compress)
Sets the data associated with the stream, either compressed or uncompressed. Note that the data will never be compressed if Document.compress is set to false.

Parameters: data raw data, decrypted and uncompressed. compress true if you want the stream to be compressed.

Since: iText 2.1.1

setData

public void setData(byte[] data, boolean compress, int compressionLevel)
Sets the data associated with the stream, either compressed or uncompressed. Note that the data will never be compressed if Document.compress is set to false.

Parameters: data raw data, decrypted and uncompressed. compress true if you want the stream to be compressed. compressionLevel a value between -1 and 9 (ignored if compress == false)

Since: iText 2.1.3

setData

public void setData(byte[] data)
Sets the data associated with the stream

Parameters: data raw data, decrypted and uncompressed.

setLength

public void setLength(int length)

setObjNum

public void setObjNum(int objNum, int objGen)

toPdf

public void toPdf(PdfWriter writer, OutputStream os)