public class PRStream extends PdfStream
Modifier and Type | Field and Description |
---|---|
protected int |
length |
protected int |
objGen |
protected int |
objNum |
protected int |
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,
int 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() |
int |
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 |
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
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 int 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, int offset)
public PRStream(PdfReader reader, byte[] conts)
public PRStream(PdfReader reader, byte[] conts, int compressionLevel)
reader
- the reader that holds the existing PDFconts
- the new contentcompressionLevel
- the compression level for the contentpublic 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 setData(byte[] data)
data
- raw data, decrypted and uncompressed.public void setLength(int length)
public int 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 compatibilityos
- the OutputStream
to write the bytes to.IOException
PdfDictionary.toPdf(com.lowagie.text.pdf.PdfWriter, java.io.OutputStream)
Copyright © 2018. All rights reserved.