public class PRStream extends PdfStream
Modifier and Type | Field and Description |
---|---|
protected int |
length |
protected int |
objGen |
protected int |
objNum |
protected long |
offset |
protected PdfReader |
reader |
BEST_COMPRESSION, BEST_SPEED, compressed, compressionLevel, DEFAULT_COMPRESSION, inputStream, inputStreamLength, NO_COMPRESSION, rawLength, ref, streamBytes, writer
Constructor and 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) |
Modifier and Type | Method and Description |
---|---|
byte[] |
getBytes()
Gets the presentation of this object in a byte array
|
int |
getLength() |
long |
getOffset() |
PdfReader |
getReader() |
void |
setData(byte[] data)
Sets the data associated with the stream
|
void |
setData(byte[] data, boolean compress)
Sets the data associated with the stream, either compressed or uncompressed.
|
void |
setData(byte[] data, boolean compress, int compressionLevel)
Sets the data associated with the stream, either compressed or uncompressed.
|
void |
setDataRaw(byte[] data)
Sets the data associated with the stream, as-is.
|
void |
setLength(int length) |
void |
setObjNum(int objNum, int objGen) |
void |
toPdf(PdfWriter writer, OutputStream os)
Writes the PDF representation of this PdfDictionary as an array of byte to the given OutputStream .
|
flateCompress, flateCompress, getRawLength, superToPdf, toString, writeContent, writeLength
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
canBeInObjStm, getIndRef, isArray, isBoolean, isDictionary, isIndirect, isName, isNull, isNumber, isStream, isString, length, setContent, setIndRef, type
protected PdfReader reader
protected long offset
protected int length
protected int objNum
protected int objGen
public PRStream(PRStream stream, PdfDictionary newDic)
public PRStream(PRStream stream, PdfDictionary newDic, PdfReader reader)
public PRStream(PdfReader reader, long offset)
public PRStream(PdfReader reader, byte[] conts)
public PRStream(PdfReader reader, byte[] conts, int compressionLevel)
reader
- the reader that holds the existing PDF
conts
- the new content
compressionLevel
- the compression level for the content
public void setData(byte[] data, boolean compress)
data
- raw data, decrypted and uncompressed.
compress
- true if you want the stream to be compressed.
public void setData(byte[] data, boolean compress, int compressionLevel)
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)
public void setDataRaw(byte[] data)
data
- data, possibly encrypted and/or compressed
public void setData(byte[] data)
data
- raw data, decrypted and uncompressed.
public void setLength(int length)
public long getOffset()
public int getLength()
public PdfReader getReader()
public byte[] getBytes()
PdfObject
public void setObjNum(int objNum, int objGen)
public void toPdf(PdfWriter writer, OutputStream os) throws IOException
PdfDictionary
PdfDictionary
as an array of byte
to the given OutputStream
.
toPdf
in class PdfStream
writer
- for backwards compatibility
os
- the OutputStream
to write the bytes to.
IOException
PdfDictionary.toPdf(com.itextpdf.text.pdf.PdfWriter, java.io.OutputStream)
Copyright © 2016. All rights reserved.