New to Telerik Document ProcessingStart a free 30-day trial

Base for text-based format providers that import and export documents from/to strings, useful when handling document text (such as PDF-derived content).

Definition

Constructors

C#
protected TextBasedFormatProviderBase()

Methods

Exports the document to a text string with an optional timeout.

C#
public string Export(T document, TimeSpan? timeout)
Parameters:documentT

The document.

timeoutTimeSpan?

The timeout after which the operation will be cancelled.

Returns:

string

The result string.

Exceptions:

ArgumentOutOfRangeException

The exception that is thrown when timeout is less than -1 or greater than Int32.MaxValue. Note that this upper bound is more restrictive than TimeSpan.MaxValue.

Implements: ITextBasedFormatProvider<T>.Export(T, TimeSpan?)

Imports a document from a text string with an optional timeout and returns the parsed document.

C#
public T Import(string input, TimeSpan? timeout)
Parameters:inputstring

The input.

timeoutTimeSpan?

The timeout after which the operation will be cancelled.

Returns:

T

The result document.

Exceptions:

ArgumentOutOfRangeException

The exception that is thrown when timeout is less than -1 or greater than Int32.MaxValue. Note that this upper bound is more restrictive than TimeSpan.MaxValue.

Implements: ITextBasedFormatProvider<T>.Import(string, TimeSpan?)