@kenyog/rtf-to-quill-delta
converter from rtf file to quill delta format.
Last updated a year ago by kenyog .
MIT · Original npm · Tarball · package.json
$ cnpm install @kenyog/rtf-to-quill-delta 
SYNC missed versions from official npm registry.

rtf-to-quill-delta

This is a Node.js module for converting rtf file into quill delta format.

Requirement

This modules depends on following modules.

Usage

sample program

const RtfToDeltaConverter = require('@kenyog/rtf-to-quill-delta');
async function main() {
  let rtf = await readFile('test.rtf', {encoding: 'ascii'});
  let converter = new RtfToDeltaConverter();
  let delta = await converter.convert(rtf);
  console.log(JSON.stringify(delta, null, 2));
}

Output

{
  "ops": [
    {
      "insert": "ai",
      "attributes": {
        "size": "8px",
        "color": "#000000"
      }
    },
    {
      "insert": "ueoaiu",
      "attributes": {
        "bold": true,
        "size": "10.6px",
        "color": "#000000"
      }
    },
    {
      "insert": "eo",
      "attributes": {
        "bold": false,
        "size": "8px",
        "color": "#000000"
      }
    },
    {
      "insert": "\n"
    }
  ]
}

Install

npm install @kenyog/rtf-to-quill-delta

Licence

MIT

Author

kenyog

Current Tags

  • 0.2.0                                ...           latest (a year ago)

4 Versions

  • 0.2.0                                ...           a year ago
  • 0.1.0                                ...           2 years ago
  • 0.0.2                                ...           2 years ago
  • 0.0.1                                ...           2 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 1
Last Day 0
Last Week 0
Last Month 2
Dependencies (3)
Dev Dependencies (1)
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |