Package com.itextpdf.text.pdf
Class PRStream
- java.lang.Object
-
- com.itextpdf.text.pdf.PdfObject
-
- com.itextpdf.text.pdf.PdfDictionary
-
- com.itextpdf.text.pdf.PdfStream
-
- com.itextpdf.text.pdf.PRStream
-
- All Implemented Interfaces:
java.io.Serializable
public class PRStream extends PdfStream
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected intlengthprotected intobjGenprotected intobjNumprotected longoffsetprotected PdfReaderreader-
Fields inherited from class com.itextpdf.text.pdf.PdfStream
BEST_COMPRESSION, BEST_SPEED, compressed, compressionLevel, DEFAULT_COMPRESSION, ENDSTREAM, inputStream, inputStreamLength, NO_COMPRESSION, rawLength, ref, SIZESTREAM, STARTSTREAM, streamBytes, writer
-
-
Constructor Summary
Constructors Constructor Description 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.PRStream(PdfReader reader, long offset)PRStream(PRStream stream, PdfDictionary newDic)PRStream(PRStream stream, PdfDictionary newDic, PdfReader reader)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description byte[]getBytes()Gets the presentation of this object in a byte arrayintgetLength()(package private) intgetObjGen()(package private) intgetObjNum()longgetOffset()PdfReadergetReader()voidsetData(byte[] data)Sets the data associated with the streamvoidsetData(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.voidsetDataRaw(byte[] data)Sets the data associated with the stream, as-is.voidsetLength(int length)voidsetObjNum(int objNum, int objGen)voidtoPdf(PdfWriter writer, java.io.OutputStream os)Writes the PDF representation of thisPdfDictionaryas an array ofbyteto the givenOutputStream.-
Methods inherited from class com.itextpdf.text.pdf.PdfStream
flateCompress, flateCompress, getRawLength, superToPdf, toString, writeContent, writeLength
-
Methods inherited from class com.itextpdf.text.pdf.PdfDictionary
checkType, clear, contains, get, getAsArray, getAsBoolean, getAsDict, getAsIndirectObject, getAsName, getAsNumber, getAsStream, getAsString, getDirectObject, getKeys, isCatalog, isFont, isOutlineTree, isPage, isPages, merge, mergeDifferent, put, putAll, putEx, remove, size
-
Methods inherited from class com.itextpdf.text.pdf.PdfObject
canBeInObjStm, getIndRef, isArray, isBoolean, isDictionary, isIndirect, isName, isNull, isNumber, isStream, isString, length, setContent, setIndRef, type
-
-
-
-
Field Detail
-
reader
protected PdfReader reader
-
offset
protected long offset
-
length
protected int length
-
objNum
protected int objNum
-
objGen
protected int objGen
-
-
Constructor Detail
-
PRStream
public PRStream(PRStream stream, PdfDictionary newDic)
-
PRStream
public PRStream(PRStream stream, PdfDictionary newDic, PdfReader reader)
-
PRStream
public PRStream(PdfReader reader, long 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 PDFconts- the new contentcompressionLevel- the compression level for the content- Since:
- 2.1.3 (replacing the existing constructor without param compressionLevel)
-
-
Method Detail
-
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
-
setDataRaw
public void setDataRaw(byte[] data)
Sets the data associated with the stream, as-is. This method will not remove or change any existing filter: the data has to match an existing filter or an appropriate filter has to be set.- Parameters:
data- data, possibly encrypted and/or compressed- Since:
- 5.5.0
-
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)
-
getOffset
public long getOffset()
-
getLength
public int getLength()
-
getReader
public PdfReader getReader()
-
getBytes
public byte[] getBytes()
Description copied from class:PdfObjectGets the presentation of this object in a byte array
-
setObjNum
public void setObjNum(int objNum, int objGen)
-
getObjNum
int getObjNum()
-
getObjGen
int getObjGen()
-
toPdf
public void toPdf(PdfWriter writer, java.io.OutputStream os) throws java.io.IOException
Description copied from class:PdfDictionaryWrites the PDF representation of thisPdfDictionaryas an array ofbyteto the givenOutputStream.- Overrides:
toPdfin classPdfStream- Parameters:
writer- for backwards compatibilityos- theOutputStreamto write the bytes to.- Throws:
java.io.IOException- See Also:
PdfDictionary.toPdf(com.itextpdf.text.pdf.PdfWriter, java.io.OutputStream)
-
-