1.1.3 • Published 2 years ago

read-rtf v1.1.3

Weekly downloads
-
License
MIT
Repository
-
Last release
2 years ago

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.