Skip to content

Latest commit

 

History

History
116 lines (89 loc) · 4.63 KB

API.md

File metadata and controls

116 lines (89 loc) · 4.63 KB

Classes

UnRTF

Typedefs

OptionDetails : object
UnRTFAcceptedOptions : Record.<string, OptionDetails>
UnRTFOptions

UnRTF

Kind: global class

new UnRTF([binPath])

Param Type Description
[binPath] string Path of UnRTF binary. If not provided, the constructor will attempt to find the binary in the PATH environment variable. For win32, a binary is bundled with the package and will be used if a local installation is not found.

unRTF.unrtfAcceptedOptions : UnRTFAcceptedOptions

Kind: instance property of UnRTF

unRTF.path ⇒ string

Returns the path of the UnRTF binary.

Kind: instance property of UnRTF
Returns: string - Path of UnRTF binary.

unRTF.version ⇒ string

Returns the version of the UnRTF binary.

Kind: instance property of UnRTF
Returns: string - Version of UnRTF binary.

unRTF.convert(file, [options]) ⇒ Promise.<string>

Converts an RTF file to HTML/LaTeX/RTF/TXT. Defaults to HTML output if no output* options are provided. UnRTF will use the directory of the original file to store embedded pictures.

Kind: instance method of UnRTF
Returns: Promise.<string> - A promise that resolves with a stdout string, or rejects with an Error object.
Author: Frazer Smith

Param Type Description
file string Filepath of the RTF file to read.
[options] UnRTFOptions Options to pass to UnRTF binary.

UnRTF.UnRTF : string | undefined

Kind: static property of UnRTF

OptionDetails : object

Kind: global typedef
Properties

Name Type Description
arg string The argument to pass to the binary.
type 'boolean' | 'number' | 'string' The type of the option.
minVersion string The minimum version of the binary that supports this option.
[maxVersion] string The maximum version of the binary that supports this option (optional).

UnRTFAcceptedOptions : Record.<string, OptionDetails>

Kind: global typedef

UnRTFOptions

Kind: global typedef
Properties

Name Type Description
[noPictures] boolean Disable the automatic storing of embedded pictures to the current working directory.
[noRemap] boolean Disable charset conversion (only works for 8-bit charsets) (UnRTF v0.20.5 or later only).
[outputHtml] boolean Generate HTML output.
[outputLatex] boolean Generate LaTeX output.
[outputPs] boolean Generate PostScript (PS) output (UnRTF v0.19.4 or earlier only).
[outputRtf] boolean Generate RTF output. (UnRTF v0.21.3 or later only).
[outputText] boolean Generate ASCII text output.
[outputVt] boolean Generate text output with VT100 escape codes.
[outputWpml] boolean Generate WPML output (UnRTF v0.19.4 or earlier only).
[printVersionInfo] boolean Print copyright and version info.
[quiet] boolean Do not print any leading comments in output (UnRTF v0.21.3 or later only).