HiraokaHyperTools.iTextSharp-LGPL  0.2.5
iTextSharp.text.pdf.PdfStream Class Reference
Inheritance diagram for iTextSharp.text.pdf.PdfStream:
iTextSharp.text.pdf.PdfDictionary iTextSharp.text.pdf.PdfObject iTextSharp.text.pdf.PRStream iTextSharp.text.pdf.PdfContents iTextSharp.text.pdf.PdfEFStream iTextSharp.text.pdf.PdfFormXObject iTextSharp.text.pdf.PdfICCBased iTextSharp.text.pdf.PdfImage iTextSharp.text.pdf.PdfPattern

Public Member Functions

 PdfStream (byte[] bytes)
 
 PdfStream (Stream inputStream, PdfWriter writer)
 
void WriteLength ()
 
void FlateCompress ()
 
void FlateCompress (int compressionLevel)
 
override void ToPdf (PdfWriter writer, Stream os)
 
void WriteContent (Stream os)
 
override String ToString ()
 
- Public Member Functions inherited from iTextSharp.text.pdf.PdfDictionary
 PdfDictionary ()
 
 PdfDictionary (PdfName type)
 
void Put (PdfName key, PdfObject value)
 
void PutEx (PdfName key, PdfObject value)
 
void Remove (PdfName key)
 
PdfObject Get (PdfName key)
 
bool IsFont ()
 
bool IsPage ()
 
bool IsPages ()
 
bool IsCatalog ()
 
bool IsOutlineTree ()
 
void Merge (PdfDictionary other)
 
void MergeDifferent (PdfDictionary other)
 
bool Contains (PdfName key)
 
virtual IDictionaryEnumerator GetEnumerator ()
 
override String ToString ()
 
PdfObject GetDirectObject (PdfName key)
 
PdfDictionary GetAsDict (PdfName key)
 
PdfArray GetAsArray (PdfName key)
 
PdfStream GetAsStream (PdfName key)
 
PdfString GetAsString (PdfName key)
 
PdfNumber GetAsNumber (PdfName key)
 
PdfName GetAsName (PdfName key)
 
PdfBoolean GetAsBoolean (PdfName key)
 
PdfIndirectReference GetAsIndirectObject (PdfName key)
 
- Public Member Functions inherited from iTextSharp.text.pdf.PdfObject
virtual byte[] GetBytes ()
 
bool CanBeInObjStm ()
 
override string ToString ()
 
bool IsNull ()
 
bool IsBoolean ()
 
bool IsNumber ()
 
bool IsString ()
 
bool IsName ()
 
bool IsArray ()
 
bool IsDictionary ()
 
bool IsStream ()
 
bool IsIndirect ()
 

Static Public Attributes

const int DEFAULT_COMPRESSION = -1
 
const int NO_COMPRESSION = 0
 
const int BEST_SPEED = 1
 
const int BEST_COMPRESSION = 9
 
- Static Public Attributes inherited from iTextSharp.text.pdf.PdfDictionary
static PdfName FONT = PdfName.FONT
 
static PdfName OUTLINES = PdfName.OUTLINES
 
static PdfName PAGE = PdfName.PAGE
 
static PdfName PAGES = PdfName.PAGES
 
static PdfName CATALOG = PdfName.CATALOG
 
- Static Public Attributes inherited from iTextSharp.text.pdf.PdfObject
const int BOOLEAN = 1
 
const int NUMBER = 2
 
const int STRING = 3
 
const int NAME = 4
 
const int ARRAY = 5
 
const int DICTIONARY = 6
 
const int STREAM = 7
 
const int NULL = 8
 
const int INDIRECT = 10
 
const string NOTHING = ""
 
const string TEXT_PDFDOCENCODING = "PDF"
 
const string TEXT_UNICODE = "UnicodeBig"
 

Protected Member Functions

 PdfStream ()
 
virtual void SuperToPdf (PdfWriter writer, Stream os)
 
- Protected Member Functions inherited from iTextSharp.text.pdf.PdfObject
 PdfObject (int type)
 
 PdfObject (int type, string content)
 
 PdfObject (int type, byte[] bytes)
 

Protected Attributes

bool compressed = false
 
int compressionLevel = NO_COMPRESSION
 
MemoryStream streamBytes = null
 
Stream inputStream
 
PdfIndirectReference iref
 
int inputStreamLength = -1
 
PdfWriter writer
 
int rawLength
 
- Protected Attributes inherited from iTextSharp.text.pdf.PdfObject
byte[] bytes
 
int type
 
PRIndirectReference indRef
 

Properties

int RawLength [get]
 
- Properties inherited from iTextSharp.text.pdf.PdfDictionary
ICollection Keys [get]
 
int Size [get]
 
- Properties inherited from iTextSharp.text.pdf.PdfObject
int Length [get]
 
string Content [set]
 
int Type [get]
 
PRIndirectReference IndRef [get, set]
 

Detailed Description

PdfStream is the Pdf stream object.

A stream, like a string, is a sequence of characters. However, an application can read a small portion of a stream at a time, while a string must be read in its entirety. For this reason, objects with potentially large amounts of data, such as images and page descriptions, are represented as streams.
A stream consists of a dictionary that describes a sequence of characters, followed by the keyword stream, followed by zero or more lines of characters, followed by the keyword endstream.
All streams must be PdfIndirectObjects. The stream dictionary must be a direct object. The keyword stream that follows the stream dictionary should be followed by a carriage return and linefeed or just a linefeed.
Remark: In this version only the FLATEDECODE-filter is supported.
This object is described in the 'Portable Document Format Reference Manual version 1.3' section 4.8 (page 41-53).

See also
PdfObject
PdfDictionary

Constructor & Destructor Documentation

◆ PdfStream() [1/3]

iTextSharp.text.pdf.PdfStream.PdfStream ( byte[]  bytes)

Constructs a PdfStream-object.

Parameters
bytescontent of the new PdfObject as an array of byte.

◆ PdfStream() [2/3]

iTextSharp.text.pdf.PdfStream.PdfStream ( Stream  inputStream,
PdfWriter  writer 
)

Creates an efficient stream. No temporary array is ever created. The InputStream is totally consumed but is not closed. The general usage is:

InputStream in = ...;
PdfStream stream = new PdfStream(in, writer);
stream.FlateCompress();
writer.AddToBody(stream);
stream.WriteLength();
in.Close();
Parameters
inputStreamthe data to write to this stream
writerthe PdfWriter for this stream

◆ PdfStream() [3/3]

iTextSharp.text.pdf.PdfStream.PdfStream ( )
protected

Constructs a PdfStream-object.

Member Function Documentation

◆ FlateCompress() [1/2]

void iTextSharp.text.pdf.PdfStream.FlateCompress ( )

Compresses the stream.

◆ FlateCompress() [2/2]

void iTextSharp.text.pdf.PdfStream.FlateCompress ( int  compressionLevel)

Compresses the stream.

Parameters
compressionLevelthe compression level (0 = best speed, 9 = best compression, -1 is default)
Since
2.1.3

◆ SuperToPdf()

virtual void iTextSharp.text.pdf.PdfStream.SuperToPdf ( PdfWriter  writer,
Stream  os 
)
protectedvirtual

◆ ToPdf()

override void iTextSharp.text.pdf.PdfStream.ToPdf ( PdfWriter  writer,
Stream  os 
)
virtual

Returns the PDF representation of this PdfDictionary.

Returns
an array of byte

Reimplemented from iTextSharp.text.pdf.PdfDictionary.

Reimplemented in iTextSharp.text.pdf.PRStream.

◆ ToString()

override String iTextSharp.text.pdf.PdfStream.ToString ( )
See also
com.lowagie.text.pdf.PdfObject::toString()

◆ WriteContent()

void iTextSharp.text.pdf.PdfStream.WriteContent ( Stream  os)

Writes the data content to an Stream.

Parameters
osthe destination to write to
Exceptions
IOExceptionon error

◆ WriteLength()

void iTextSharp.text.pdf.PdfStream.WriteLength ( )

Writes the stream length to the PdfWriter.

This method must be called and can only be called if the contructor PdfStream(InputStream,PdfWriter) is used to create the stream.

Exceptions
IOExceptionon error
See also
#PdfStream(InputStream,PdfWriter)

Member Data Documentation

◆ BEST_COMPRESSION

const int iTextSharp.text.pdf.PdfStream.BEST_COMPRESSION = 9
static

A possible compression level.

Since
2.1.3

◆ BEST_SPEED

const int iTextSharp.text.pdf.PdfStream.BEST_SPEED = 1
static

A possible compression level.

Since
2.1.3

◆ compressed

bool iTextSharp.text.pdf.PdfStream.compressed = false
protected

is the stream compressed?

◆ compressionLevel

int iTextSharp.text.pdf.PdfStream.compressionLevel = NO_COMPRESSION
protected

The level of compression.

Since
2.1.3

◆ DEFAULT_COMPRESSION

const int iTextSharp.text.pdf.PdfStream.DEFAULT_COMPRESSION = -1
static

A possible compression level.

Since
2.1.3

◆ inputStream

Stream iTextSharp.text.pdf.PdfStream.inputStream
protected

◆ inputStreamLength

int iTextSharp.text.pdf.PdfStream.inputStreamLength = -1
protected

◆ iref

PdfIndirectReference iTextSharp.text.pdf.PdfStream.iref
protected

◆ NO_COMPRESSION

const int iTextSharp.text.pdf.PdfStream.NO_COMPRESSION = 0
static

A possible compression level.

Since
2.1.3

◆ rawLength

int iTextSharp.text.pdf.PdfStream.rawLength
protected

◆ streamBytes

MemoryStream iTextSharp.text.pdf.PdfStream.streamBytes = null
protected

◆ writer

PdfWriter iTextSharp.text.pdf.PdfStream.writer
protected

Property Documentation

◆ RawLength

int iTextSharp.text.pdf.PdfStream.RawLength
get

The documentation for this class was generated from the following file: