read-rtf

1.1.3 • Public • Published

rtf util

This is a util which can parse rtf file and convert it to html format. Support image and table convert. It may has some trouble in special character.

get started

const {RtfParser} = require("read-rtf");
const {RtfConverter} = require("read-rtf");

let parser = new RtfParser();
let converter = new RtfConverter();
let rtfGroup = parser.parse(temp);
let htmlContent converter.convert(rtfGroup)

text extraction

Basically this could be used to extract plain text from RTF document.

const fs = require('fs')
let qw = new RtfParser();
let rtfContent = fs.readFileSync('%MY_RTF_DOCUMENT%', "utf-8");
qw.parse(rtfContent);
const extractedText = qw.rawText;

warning

This is an experimental util, don't use in production environment.

Readme

Keywords

Package Sidebar

Install

npm i read-rtf

Weekly Downloads

1,027

Version

1.1.3

License

MIT

Unpacked Size

60.9 kB

Total Files

15

Last publish

Collaborators

  • sweetsnakesugar