Foxit PDF SDK

Instance Methods | Class Methods | List of all members
FSPDFStream Class Reference
Inheritance diagram for FSPDFStream:

## Instance Methods
(id< FSFileReaderCallback >) | - exportData:
| Export stream data. More...
(NSData *) | - getData:
| Get stream data. More...
(unsigned long long) | - getDataSize:
| Get the size of stream data, in bytes. More...
(FSPDFDictionary *) | - getDictionary
| Get the PDF dictionary object associated to current PDF stream object. More...
(FSPDFStreamFilter) | - getStreamFilter
| Get the type of stream filter which indicate how the stream data must be decoded before the data is used. More...
(void) | - importData:stream_filter:
| Import stream data. More...
(void) | - setData:
| Set stream data. More...
Instance Methods inherited from FSPDFObject
(FSPDFObject *) | - cloneObject
| Clone current PDF object and get the cloned PDF object. More...
(FSPDFObject *) | - deepCloneObject
| Clone current PDF object and get the cloned PDF object. More...
(void) | - destroy
| Release a newly created PDF object or a clone PDF object, which is not related to PDF document or other PDF object and will not be used any more. More...
(FSPDFArray *) | - getArray
| Get the PDF array object of current PDF object. More...
(BOOL) | - getBoolean
| Get the boolean value of current PDF object. More...
(FSDateTime *) | - getDateTime
| Get the date time value of current PDF object. More...
(FSPDFDictionary *) | - getDict
| Get the PDF dictionary object of current PDF object. More...
(FSPDFObject *) | - getDirectObject
| Get the direct object of current PDF object. More...
(float) | - getFloat
| Get the float value of current PDF object. More...
(int) | - getInteger
| Get the integer value of current PDF object. More...
(FSMatrix2D *) | - getMatrix
| Get the matrix value of current PDF object. More...
(NSString *) | - getName
| Get the name value of current PDF object. More...
(unsigned int) | - getObjNum
| Get the indirect object number of current PDF object. More...
(FSRectF *) | - getRect
| Get the rectangle value of current PDF object. More...
(FSPDFStream *) | - getStream
| Get the PDF stream object of current PDF object. More...
(NSData *) | - getString
| Get the string value of current PDF object. More...
(FSPDFObjectType) | - getType
| Get the type of current PDF object. More...
(NSString *) | - getWideString
| Get the wide string value of current PDF object. More...
(BOOL) | - isIdentical:
| Check if input PDF object is identical with current PDF object. More...

## Class Methods
(FSPDFStream *) | + create:
| Create a new stream object based on a dictionary. More...
Class Methods inherited from FSPDFObject
(FSPDFObject *) | + createFromBoolean:
| Create a PDF object from a boolean value. More...
(FSPDFObject *) | + createFromDateTime:
| Create a PDF object from date time. More...
(FSPDFObject *) | + createFromFloat:
| Create a PDF object from a float number. More...
(FSPDFObject *) | + createFromInteger:
| Create a PDF object from a integer number. More...
(FSPDFObject *) | + createFromName:
| Create a PDF object from a string which represents a name. More...
(FSPDFObject *) | + createFromNameW:
| Create a PDF object from a string which represents a name. More...
(FSPDFObject *) | + createFromString:
| Create a PDF object from string. More...
(FSPDFObject *) | + createFromStringWithLength:length:
| Create a PDF object from string. More...
(FSPDFObject *) | + createReference:object_number:
| Create a reference for an indirect object. More...

## Detailed Description

A PDF stream object consists of a direct dictionary object and stream data. For more details, please refer to Section 3.2.7 "Stream Objects" in <PDF Reference 1.7>.
Class FSPDFStream is derived from FSPDFObject and offers functions to create a new PDF stream object and get/set stream data.

See also
  FSPDFObject

## Method Documentation

## ◆ create:()

+ (FSPDFStream *) create: |  | (FSPDFDictionary*) | dictionary |

Create a new stream object based on a dictionary.

Please call function FSPDFObject::destroy to release the created object if it has not been added/set into PDF document or other PDF object and will not be used any more.

Parameters

  [in] | dictionary | A PDF dictionary object: If this is nil, PDF stream object will be created based on an empty PDF dictionary. If this is not nil, after creating PDF stream object successfully, do not call FSPDFObject::destroy for this PDF dictionary object.

Returns
  A new FSPDFStream object. If there is any error, this function will return nil.

## ◆ exportData:()

- (id< FSFileReaderCallback >) exportData: |  | (BOOL) | is_raw_data |

Export stream data.

This function provides an efficient way to get the stream data, especially for large stream data.

Parameters

  [in] | is_raw_data | A boolean value that indicates whether to get raw data or not: YES means to get raw data, and NO means to get decoded data (original data).

Returns
  A FSFileReaderCallback object which can be used to read stream data. Please remeber to use callback function Relase() of the returned FSFileReaderCallback object to release this FSFileReaderCallback object when not use it any more.

Note
  If current stream object is released or related PDF document is closed, do not use returned FSFileReaderCallback object any more; otherwise, unexpected error or crash will occur.

## ◆ getData:()

- (NSData *) getData: |  | (BOOL) | is_raw_data |

Get stream data.

When calling this function, user should pass a memory block with enough size to retrieve data. User is recommended to call function FSPDFStream::getDataSize: (with same parameter is_raw_data) to get the expected size, then prepare the memory block, and then call this function to get data.

Parameters

  [in] | is_raw_data | A boolean value that indicates whether to get raw data or not: YES means to get raw data, and NO means to get decoded data (original data).

Returns
  YES means success, while NO means failed.

## ◆ getDataSize:()

- (unsigned long long) getDataSize: |  | (BOOL) | is_raw_data |

Get the size of stream data, in bytes.

Parameters

  [in] | is_raw_data | A boolean value that indicates whether to get raw data or not: YES means to get raw data, and NO means to get decoded data (original data).

Returns
  The data size, in bytes.

## ◆ getDictionary()

- (FSPDFDictionary *) getDictionary |  |  |

Get the PDF dictionary object associated to current PDF stream object.

Returns
  The stream dictionary. If there is any error, this function will return nil.

## ◆ getStreamFilter()

- (FSPDFStreamFilter) getStreamFilter |  |  |

Get the type of stream filter which indicate how the stream data must be decoded before the data is used.

Returns
  The type of stream filter. Please refer to values starting from FSPDFStreamUnknown and this would be one of these values.

## ◆ importData:stream_filter:()

- (void) importData: |  | (id<FSFileReaderCallback>) | file_read
stream_filter: |  | (FSPDFStreamFilter) | stream_filter

Import stream data.

Parameters

  [in] | file_read | A FSFileReaderCallback object implemented by user. Foxit PDF SDK will use this to read stream data and set to current PDF stream object. User should keep this callback valid until the related PDF document is closed or current stream object is released because of useless.
  [in] | stream_filter | Type of stream filter, which specifies how to decode the data which is read through parameter file_read. Please refer to values starting from FSPDFStreamNoneDecode and this should be one of these values except FSPDFStreamUnknown.

Returns
  None.

## ◆ setData:()

- (void) setData: |  | (NSData *) | buffer |

Set stream data.

Parameters

  [in] | buffer | A memory block that represents the new stream data to be set.

Returns
  None.