Git Product home page Git Product logo

docx-html-editor's Introduction

docx-html-editor

A proof of concept (JAX-RS 2.0) to show how a web-based HTML rich text editors (eg CkEditor) can be used to edit docx files (via XHTML round trip).

We've published this as a "cheap and cheerful" option only; in 2016, Plutext will be introducing a better web editor, using the layout engine behind our commercial PDF Converter offering.

That said, it should work OK for documents containing text, tables, and images. Exotic Word features are not supported.

Interested docx4j community members are welcome to improve it and offer pull requests.

docx-html-editor is licensed under the AGPLv3. This means you have to publish any changes you make.

How it works

The idea is:

  • use docx4j to convert the docx to XHTML
  • use CKEditor to edit that XHTML in the web browser
  • on submit, convert the XHTML back to docx content

The general problem with converting to/from XHTML is the “impendance mismatch”. That is, losing stuff during round trip. This will be a familiar problem to anyone who has ever edited a docx in Google Docs or LibreOffice.

This demo addresses that problem by identifying docx content which CKEditor would mangle, and then on submit/save, using the original docx content for those bits.

In this demo, the problematic content is replaced with visual placeholders, so you can see it is there.

Getting started

Pre-reqs: Since we don't distribute a binary, you'll need maven to build from source.

Get CKeditor (v3.6.6.1); unzip it to src/main/webapp/ckeditor (so you have src/main/webapp/ckeditor/ckeditor.js etc)

Build the war:

 mvn install

Load the resulting war file from dir target to your app server (eg Tomcat)

Visit the upload page in your web browser

/docx-html-editor/

There's a bit more doco at https://github.com/plutext/docx-html-editor/blob/master/documentation/user/docx-html-editor_UserManual.docx?raw=true

Developing

Set this up as a Maven project (eg in Eclipse) to get the dependencies.

docx-html-editor's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

docx-html-editor's Issues

[ERROR] Failed to execute goal on project docx-html-editor

Good day, I am new to Maven and we want to try out this project, but I am getting the error below. Any assistance will be much appreciated.

[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.746 s
[INFO] Finished at: 2019-03-05T13:34:48+02:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project docx-html-editor: Could not resolve dependencies for project com.plutext:docx-html-editor:war:0.0.1-SNAPSHOT: Failure to find org.capaxit.textimage:TextImageGen:jar:2.0-SNAAPSHOT in https://repo.maven.apache.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/DependencyResolutionException

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.