Class PRStream
java.lang.Object
com.gitlab.pdftk_java.com.lowagie.text.pdf.PdfObject
com.gitlab.pdftk_java.com.lowagie.text.pdf.PdfDictionary
com.gitlab.pdftk_java.com.lowagie.text.pdf.PdfStream
com.gitlab.pdftk_java.com.lowagie.text.pdf.PRStream
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected int
protected int
protected int
protected int
protected PdfReader
Fields inherited from class com.gitlab.pdftk_java.com.lowagie.text.pdf.PdfStream
BEST_COMPRESSION, BEST_SPEED, compressed, compressionLevel, DEFAULT_COMPRESSION, ENDSTREAM, inputStream, inputStreamLength, NO_COMPRESSION, rawLength, ref, SIZESTREAM, STARTSTREAM, streamBytes, writer
-
Constructor Summary
ConstructorsConstructorDescriptionCreates a new PDF stream object that will replace a stream in a existing PDF file.PRStream
(PRStream stream, PdfDictionary newDic) PRStream
(PRStream stream, PdfDictionary newDic, PdfReader reader) -
Method Summary
Modifier and TypeMethodDescriptionboolean
byte[]
getBytes()
Gets the presentation of this object in a byte arrayint
(package private) int
(package private) int
int
void
setData
(byte[] data) Sets the data associated with the streamvoid
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) Returns the PDF representation of thisPdfDictionary
.Methods inherited from class com.gitlab.pdftk_java.com.lowagie.text.pdf.PdfStream
flateCompress, flateCompress, getRawLength, superToPdf, toString, writeContent, writeLength
Methods inherited from class com.gitlab.pdftk_java.com.lowagie.text.pdf.PdfDictionary
contains, get, getAsArray, getAsBoolean, getAsDict, getAsIndirectObject, getAsName, getAsNumber, getAsStream, getAsString, getDirectObject, getKeys, isCatalog, isDictionaryType, isFont, isOutlineTree, isPage, isPages, merge, mergeDifferent, put, putAll, putDel, putEx, remove, size
Methods inherited from class com.gitlab.pdftk_java.com.lowagie.text.pdf.PdfObject
canBeInObjStm, getIndRef, isArray, isBoolean, isDictionary, isIndirect, isName, isNull, isNumber, isStream, isString, length, setContent, setIndRef, type
-
Field Details
-
reader
-
offset
protected int offset -
length
protected int length -
objNum
protected int objNum -
objGen
protected int objGen
-
-
Constructor Details
-
PRStream
-
PRStream
-
PRStream
-
PRStream
-
PRStream
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 Details
-
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) -
getOffset
public int getOffset() -
getLength
public int getLength() -
getReader
-
getBytes
public byte[] getBytes()Description copied from class:PdfObject
Gets the presentation of this object in a byte array -
setObjNum
public void setObjNum(int objNum, int objGen) -
getObjNum
int getObjNum() -
getObjGen
int getObjGen() -
toPdf
Description copied from class:PdfDictionary
Returns the PDF representation of thisPdfDictionary
.- Overrides:
toPdf
in classPdfStream
- Parameters:
writer
- for backwards compatibilityos
- the outputstream to write the bytes to.- Throws:
IOException
- See Also:
-
filtersAreKnown
public boolean filtersAreKnown()
-