Class FilterWriter
FilterWriter is a utility class providing a convenient way to write data to an output filter (using Filter directly is not very intuitive).
Inheritance
Namespace: pdftron.Filters
Assembly: PDFTronDotNet.dll
Syntax
public class FilterWriter : IDisposable
Examples
StdFile outfile=new StdFile("file.dat"), StdFile.e_write_mode);
FilterWriter fwriter=new FilterWriter(outfile);
byte[] buf=...
fwriter.writeBuffer(buf);
fwriter.flush();
Constructors
FilterWriter()
Instantiates a new filter writer.
Declaration
public FilterWriter()
Exceptions
Type | Condition |
---|---|
PDFNetException | PDFNetException the PDFNet exception |
FilterWriter(Filter)
Instantiates a new filter writer.
Declaration
public FilterWriter(Filter output_filter)
Parameters
Type | Name | Description |
---|---|---|
Filter | output_filter | the filter |
Exceptions
Type | Condition |
---|---|
PDFNetException | PDFNetException the PDFNet exception |
Methods
AttachFilter(Filter)
Attaches a filter to the this FilterWriter.
Declaration
public void AttachFilter(Filter filter)
Parameters
Type | Name | Description |
---|---|---|
Filter | filter | the filter |
Exceptions
Type | Condition |
---|---|
PDFNetException | PDFNetException the PDFNet exception |
Count()
Count.
Declaration
public Int32 Count()
Returns
Type | Description |
---|---|
Int32 |
|
Exceptions
Type | Condition |
---|---|
PDFNetException | PDFNetException the PDFNet exception |
Destroy()
Declaration
public void Destroy()
Dispose()
Declaration
public void Dispose()
Dispose(Boolean)
Declaration
protected virtual void Dispose(bool disposing)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | disposing |
Finalize()
Releases all resources used by the FilterWriter
Declaration
protected void Finalize()
Flush()
Forces any data remaining in the buffer to be written to input or output filter.
Declaration
public void Flush()
Exceptions
Type | Condition |
---|---|
PDFNetException | PDFNetException the PDFNet exception |
FlushAll()
Forces any data remaining in the filter chain to the source or destination.
Declaration
public void FlushAll()
Exceptions
Type | Condition |
---|---|
PDFNetException | PDFNetException the PDFNet exception |
GetAttachedFilter()
Gets the attached filter.
Declaration
public Filter GetAttachedFilter()
Returns
Type | Description |
---|---|
Filter |
|
Exceptions
Type | Condition |
---|---|
PDFNetException | PDFNetException the PDFNet exception |
Seek(Int32, Filter.ReferencePos)
Sets the position within the current stream.
Declaration
public void Seek(Int32 offset, Filter.ReferencePos origin)
Parameters
Type | Name | Description |
---|---|---|
Int32 | offset |
|
Filter.ReferencePos | origin |
|
Remarks
- After each Seek() operation the number of consumed bytes (i.e. Count()) is set to 0.
Exceptions
Type | Condition |
---|---|
PDFNetException | PDFNetException the PDFNet exception |
Tell()
Reports the current read position in the stream relative to the stream origin.
Declaration
public Int32 Tell()
Returns
Type | Description |
---|---|
Int32 |
|
Exceptions
Type | Condition |
---|---|
PDFNetException | PDFNetException the PDFNet exception |
WriteBuffer(Byte[])
Write buffer.
Declaration
public Int32 WriteBuffer(byte[] buf)
Parameters
Type | Name | Description |
---|---|---|
System.Byte[] | buf | the buf |
Returns
Type | Description |
---|---|
Int32 |
|
Exceptions
Type | Condition |
---|---|
PDFNetException | PDFNetException the PDFNet exception |
WriteFilter(FilterReader)
Write the entire input stream to the output stream (i.e. to this FilterWriter).
Declaration
public void WriteFilter(FilterReader reader)
Parameters
Type | Name | Description |
---|---|---|
FilterReader | reader | A FilterReader attached to an input stream. |
Exceptions
Type | Condition |
---|---|
PDFNetException | PDFNetException the PDFNet exception |
WriteInt(Int32)
Write a 32 bit integer to the output stream.
Declaration
public void WriteInt(Int32 num)
Parameters
Type | Name | Description |
---|---|---|
Int32 | num | An integer to write to the output stream. |
Exceptions
Type | Condition |
---|---|
PDFNetException | PDFNetException the PDFNet exception |
WriteInt(Int64)
Write a 64 bit integer to the output stream.
Declaration
public void WriteInt(Int64 num)
Parameters
Type | Name | Description |
---|---|---|
Int64 | num | An integer to write to the output stream. |
Exceptions
Type | Condition |
---|---|
PDFNetException | PDFNetException the PDFNet exception |
WriteLine(String)
Write out a null terminated 'line' followed by a end of line character default end of line character is carriage return.
Declaration
public void WriteLine(string str)
Parameters
Type | Name | Description |
---|---|---|
System.String | str | the line |
Exceptions
Type | Condition |
---|---|
PDFNetException | PDFNetException the PDFNet exception |
WriteString(String)
Write a string to the output stream.
Declaration
public void WriteString(string str)
Parameters
Type | Name | Description |
---|---|---|
System.String | str | A string to write to the output stream. |
Exceptions
Type | Condition |
---|---|
PDFNetException | PDFNetException the PDFNet exception |
WriteUChar(Byte)
Write a single character to the output stream.
Declaration
public void WriteUChar(Byte ch)
Parameters
Type | Name | Description |
---|---|---|
Byte | ch | An unsigned character to write to the output stream. |
Exceptions
Type | Condition |
---|---|
PDFNetException | PDFNetException the PDFNet exception |