Document

simplicite~ Document

new Document()

Source:
Document

Methods

getContent() → {string}

Source:
Get the document's content (encoded in base 64)
Returns:
Content
Type
string

getContentAsArrayBuffer() → {ArrayBuffer}

Source:
Get the document's content as a an array buffer
Returns:
Content as an array buffer
Type
ArrayBuffer

getContentAsText(encodingopt) → {string}

Source:
Get the document's content as plain text
Parameters:
Name Type Attributes Description
encoding string <optional>
Encoding, defaults to UTF-8
Returns:
Content as plain text
Type
string

getDataURL(thumbnailopt) → {string}

Source:
Get the document's data URL
Parameters:
Name Type Attributes Description
thumbnail boolean <optional>
Thumbnail? If thumbnail does not exists the content is used.
Returns:
Data URL or nothing if content is empty
Type
string

getFilename() → {string}

Source:
Get the document's file name
Returns:
File name
Type
string

getFileName() → {string}

Source:
Alias to getFilename
Returns:
File name
Type
string

getId()

Source:
Get the document's ID
Returns:
ID

getMIMEType() → {string}

Source:
Get the document's MIME type
Returns:
MIME type
Type
string

getMimeType() → {string}

Source:
Alias to getMIMEType
Returns:
MIME type
Type
string

getThumbnail() → {string}

Source:
Get the document's thumbnail (encoded in base 64)
Returns:
Thumbnail
Type
string

getThumbnailAsArrayBuffer() → {ArrayBuffer}

Source:
Get the document's thumbnail as a an array buffer
Returns:
Thumbnail as an array buffer
Type
ArrayBuffer