IDocumentConversionService
Wisej.AI.Services.IDocumentConversionService
Last updated
Wisej.AI.Services.IDocumentConversionService
Last updated
Namespace: Wisej.AI.Services
Assembly: Wisej.AI (3.5.0.0)
Represents a service interface for converting documents from one format to another.
Implementations of this interface provide functionality to convert documents that are provided as a stream. This allows for flexibility in handling documents from various sources such as files or network streams. Usage of this interface requires specifying the desired output file type and optionally providing metadata for the document being converted.
Converts a document from a provided stream to plain text.
stream
The stream containing the document to be converted. It must be readable and positioned at the start of the document.
fileType
The format of the input stream represented as a string. It should be the file type, i.e.: "pdf", "docx", "html", ...
An optional output parameter to receive metadata about the document. If not provided, the default is null
.
An optional function to process each page or paragraph or section of the document being converted.
Returns: . An string representing the converted document.
This method reads a document of type fileType from the specified stream and convert it to an array strings representing either line, paragraphs or pages, depending on the conversion implementation. If the metadata parameter is provided, this method will output additional information about the document, such as the title, author, subject, pages, etc. If the iterator parameter is provided, this method will call it for each section of the document it is converting and will use the returned string value to compose the converted text. Example usage:
Throws:
Provides functionality to convert documents from various formats into text representations.
metadata
iterator
Thrown when stream or fileType is null
.