Kind: global class
- UnRTF
- new UnRTF([binPath])
- .unrtfPath :
string
|undefined
- .unrtfVersion :
string
|undefined
- .unrtfAcceptedOptions :
object
- .convert(file, [options]) ⇒
Promise.<string>
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. |
Kind: instance property of UnRTF
Kind: instance property of UnRTF
Kind: instance property of UnRTF
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] | object |
Object containing options to pass to binary. |
[options.noPictures] | boolean |
Disable the automatic storing of embedded pictures to the directory of the original file. |
[options.noRemap] | boolean |
Disable charset conversion (only works for 8-bit charsets) (UnRTF v0.20.5 or later only). |
[options.outputHtml] | boolean |
Generate HTML output. |
[options.outputLatex] | boolean |
Generate LaTeX output. |
[options.outputPs] | boolean |
Generate PostScript (PS) output (UnRTF v0.19.4 or earlier only). |
[options.outputRtf] | boolean |
Generate RTF output. (UnRTF v0.21.3 or later only). |
[options.outputText] | boolean |
Generate ASCII text output. |
[options.outputVt] | boolean |
Generate text output with VT100 escape codes. |
[options.outputWpml] | boolean |
Generate WPML output (UnRTF v0.19.4 or earlier only). |
[options.printVersionInfo] | boolean |
Print copyright and version info. |
[options.quiet] | boolean |
Do not print any leading comments in output (UnRTF v0.21.3 or later only). |