codexa / firetext

[NOT MAINTAINED] Word Processing App 📝 📖
https://marketplace.firefox.com/app/firetext
38 stars 28 forks source link

.docx support #16

Open HR opened 11 years ago

HR commented 11 years ago

I found this my microsoft for support on their formats, just download the documentation and you might find something useful. Or decompile and .apk of an android app (i.e. Quickoffice) and look at the java code if it helps. http://msdn.microsoft.com/en-us/library/cc313118%28v=office.1.2%29.aspx

HR commented 11 years ago

I'm going to create a parser for this for v2

ferndot commented 11 years ago

Ok, when we have a significant amount implemented, we can change the milestone.

Note: You probably already know this, but commits for this go to the doc branch (will be merged into the appropriate release branch. Also, files go in resources/doc/.

Thanks!

HR commented 11 years ago

Ok, here we have a js parser that we can use: https://github.com/stephen-hardy/DOCX.js

ferndot commented 11 years ago

Ya, I saw it yesterday, looks perfect :)

ferndot commented 11 years ago

Moving this to 0.2

ferndot commented 11 years ago

I am working on dropbox right now, anyone want to finish this for me?

Thanks in advance!

ferndot commented 11 years ago

Well, this is the last bug. I think we shouldn't delay the release of Firetext anymore, and we already have quite the changelog for 0.2, so if nobody wants to take this I'll move it to 0.3.

Docx files are hard because they are zips, and I have no experience with jszip.

HR commented 11 years ago

@Logi0 Can you please finish this?

HR commented 11 years ago

Can you @jackd1 finish this please?

jackd1 commented 11 years ago

Sure.

HR commented 11 years ago

:cool:

jackd1 commented 11 years ago

I've been working on Implementing this, but I can't seem to get it to work, first I had to fix some programming errors in the docx.js code, and then I finally got it to output something, but the docx file wasn't valid.

HR commented 11 years ago

use another docx file, I uploaded a docx in dp in /Firetext

jackd1 commented 11 years ago

Ok, that seemed to work, now I have to figure out how to do the opposite and convert html to docx.

HR commented 11 years ago

There is a default setting or structure that you should use (have it in resources/docx) that you duplicate everytime a user wants to save and currently only support bold, italic, underline and some other basic types that you would insert into the user docx file encoded into Open XML syntax.

HR commented 11 years ago

Maybe this could help: http://msdn.microsoft.com/en-us/library/office/aa338205(v=office.12).aspx#office2007aboutnewfileformat_developingsolutionsusingtheoffice http://msdn.microsoft.com/en-us/library/cc313153(v=office.12).aspx http://msdn.microsoft.com/en-us/library/gg278327(v=office.14).aspx http://msdn.microsoft.com/en-us/library/cc850833(v=office.14).aspx

HR commented 11 years ago

@jackd1 how is it going? By when will you finish this?

jackd1 commented 11 years ago

Actually, I've just implemented fairly simple reading of docx documents, I'll push that right now.

HR commented 11 years ago

Editing shouldn't be much harder to implement

jackd1 commented 11 years ago

No, it won't be very hard, I should be able to do that tomorrow, as well as add some more rich text features.

HR commented 11 years ago

:+1:

ferndot commented 11 years ago

:+1: How did you do this, it stumped me!

jackd1 commented 11 years ago

I wrote a custom class to interpret the document per the iso/iec 29500 spec (downloadable at http://standards.iso.org/ittf/PubliclyAvailableStandards/index.html). The load method loads a document from an ArrayBuffer (calling the constructor with an ArrayBuffer does the same thing). The HTMLout method produces html which can be edited and passed back to the HTMLin method (not yet implemented) which updates the document with the new html. Finally, when finished editing, the generate method generates the docx document. I imagine it was hard to read, it was pretty hard to read the spec :smile:

ferndot commented 11 years ago

Nice :)

jackd1 commented 11 years ago

I finally implemented writing to docx, took a little longer than I thought.

HR commented 11 years ago

Awesome

HR commented 11 years ago

We'll enhance this in the future

jackd1 commented 11 years ago

Ok, I still need to add a default template for creating new documents, also it only supports text right now.

HR commented 11 years ago

Okay, just add a header, a horizontal line and then a paragraph or user can use blank template

ferndot commented 11 years ago

Oh, does this work with Dropbox?

jackd1 commented 11 years ago

I think it should, have you tested it out?

ferndot commented 11 years ago

I can't because of all the RequireJS errors...

jackd1 commented 11 years ago

Oh, right, sorry about that, I'll try to get the script working again as soon as possible.

ferndot commented 11 years ago

@jackd1 np, I understand :)

ferndot commented 11 years ago

@jackd1 if you have time, could you rework docx.js to comply with the new firetext.parsers.parser namespace scheme?

Also, does docx.js support formatting, or is it just plain text?

HR commented 10 years ago

Is this completed yet? We need to deliver v0.3

ferndot commented 10 years ago

Guess we'll try to ship this with 0.4...

HR commented 10 years ago

@Joshua-S can you please make this compatible with the new namespacing because this is a vital feature which we need to include in v0.3

ferndot commented 10 years ago

I would but it isn't really complete. There is only plain text support, no formatting...

ferndot commented 10 years ago

Let's release this as a standalone update though, because it is important. Also see #108 which looks like it will be easy.

ferndot commented 9 years ago

Another HTML -> DOCX converter: https://github.com/evidenceprime/html-docx-js