Skip to content

gzzhanghao/docx2quill

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

docx2quill

Convert DocX to Quill Delta.

This package is under heavy development, use it at your own risk

Usage

import docx2Quill from '@gzzhanghao/docx2quill'

docx2Quill(docxBuffer, {

  /**
   * Custom image processor
   */
  async processImage(parser, filePath, size) {
    parser.delta = parser.delta.insert({
      image: await uploadImage(await parser.zip.file(filePath).async('nodebuffer'))
    }, {
      width: size.width,
      height: size.height,
    })
  },

  /**
   * Report for item not found error
   */
  notfoundError(type, id) {
    // type: number | abstract number | level | relationship | style
  },

}).then(delta => {

  // delta: Quill Delta
})

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published