Document.factoryGetDocumentForStream

Synchronously creates a #EvDocument for the document from @stream; or, if no backend handling the document's type is found, or an error occurred on opening the document, returns %NULL and fills in @error. If the document is encrypted, it is returned but also @error is set to %EV_DOCUMENT_ERROR_ENCRYPTED.

If @mime_type is non-%NULL, this overrides any type inferred from the stream. If the mime type cannot be inferred from the stream, and @mime_type is %NULL, an error is returned.

class Document
static
factoryGetDocumentForStream
(
InputStream stream
,
string mimeType
,,
Cancellable cancellable
)

Parameters

stream InputStream

a #GInputStream

mimeType string

a mime type hint

flags EvDocumentLoadFlags

flags from #EvDocumentLoadFlags

cancellable Cancellable

a #GCancellable, or %NULL

Return Value

Type: Document

a new #EvDocument, or %NULL

Throws

GException on failure.

Meta