Click or drag to resize

pdftron.Filters Namespace

Classes to work with file input and output filters
Classes
  ClassDescription
Public classCode exampleFilterReader
FilterReader is a utility class providing a convenient way to read data from an input filter (using Filter directly is not very intuitive).
Public classCode exampleFilterWriter
FilterWriter is a utility class providing a convenient way to write data to an output filter (using Filter directly is not very intuitive).
Public classInputStreamFilter
A Filter type that uses IInputStreamFilter instance as a backing store.
Public classMappedFile
MappedFile is a utility class to read files on a file system. Because MappedFile file is derived from pdftron.Filters.Filter you can directly chain MappedFile objects to other 'pdftron.Filters'. MappedFile objects support random access to files using the Seek method. Seek allows the read/write position to be moved to any position within the file. This is done through a shared memory mapped chunk manager. The byte offset is relative to the seek reference point, which can be the beginning, the current position, or the end of the underlying file, as represented by the three properties of the Filter.ReferencePos class. MappedFile objects are thread-safe, meaning separate copies of a MappedFile can Seek to different locations in the file, without conflicting with one another. Disk files always support random access. At the time of construction, the CanSeek() property value is set to true or false depending on the underlying file type.
Public classMemoryFilter
MemoryFilter is a memory buffer that can be used as a source or a sink Filter in the Filter pipeline. When a MemoryFilter is the source, other filters can read data stored in memory; When MemoryFilter is a sink, other filters generate data which is then pushed in a memory buffer owned by MemoryFilter (MemoryFilter makes sure that there is enough space to accomodate all data).
Public classOutputStreamFilter
A Filter type that uses IOutputStream instance as a backing store.
Public classRandomAccessStreamFilter
A Filter type that uses IRandomAccessStream instance as a backing store.
Interfaces
  InterfaceDescription
Public interfaceCode exampleIFilter
Provides a generic view of a sequence of bytes.

A Filter is an abstraction of a sequence of bytes, such as a file, an input/output device, an inter-process communication pipe, or a TCP/IP socket. The Filter class and its derived classes provide a generic view of these different types of input and output, isolating the programmer from the specific details of the operating system and the underlying devices.

Besides providing access to input/output sources Filters can be also to transform the data (e.g. to compress the data stream, to normalize the image data, to encrypt data, etc). Filters can also be attached to each other to form pipelines. For example, a filter used to open an image data file can be attached to a filter that decompresses the data, which is attached to another filter that will normalize the image data.

Depending on the underlying data source or repository, filters might support only some of these capabilities. An application can query a stream for its capabilities by using the IsInputFilter() and CanSeek() properties.

Examples
To read or write data to a filter, a user will typically use FilterReader/FilterWriter class. instead of using Filter methods
MappedFile file = new MappedFile("my_stream.txt", MappedFile.e_read_mode);
FilterReader reader = new FilterReader(file);
while (reader.Read(...)) ...
Enumerations
  EnumerationDescription
Public enumerationFilterReferencePos
Filter's position.
Public enumerationStdFileOpenMode
File open mode for StdFile class.