Edit documents with JavaScript in browser
This library depends on zip.js library and these APIs optionally:
docxtxtfb2odtcsvtsvrtf
Include script on your page:
<script src="js/jDoc.v.js"></script>or
<script src="js/jDoc.v.min.js"></script>where v - library version
You will be available to the global object jDoc
Read the document. Example:
jDoc.read(file, {
success: function (parsedFile) {
},
error: function (error) {
}
});file- File objectparsedFile- object with methods:html- return result as documentFragmentdata- return result as object {}
error- object, {message: ""}
error can be:
- {message: 'Invalid file format'} - invalid file format
- {message: 'Can not read file'} - System error reading file
- {message: 'First argument must be type of File'} - argument 'file' must be instanceof File
- {message: 'Invalid file type'}
- {message: 'Can't load the file'}
- {message: 'Not have the required technology'} - unsupported browser
Build a library:
grunt readers- build all engines for supported formatsgrunt readers:include- build all engines for supported formatsgrunt readers:include --rtf --oxml- build onlyrtfandoxmlenginesgrunt readers:exclude- exclude all engines from buildgrunt readers:exclude --rtf --oxml- build all engines for supported formats exceptrtfandoxmlengines
- 2013-09-10 v0.1.0 Work in progress, not yet officially released.
- 2013-11-10 v0.2.0 Support of RTF format.
Library submitted by "webschik" Knyazevich Denis