Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Any Documentation? #3

Open
stephenhobson opened this issue Mar 23, 2013 · 22 comments
Open

Any Documentation? #3

stephenhobson opened this issue Mar 23, 2013 · 22 comments

Comments

@stephenhobson
Copy link

Just wondering if you have any documentation on how to implement docx.js with JSZip? Or anything that can help me understand how DOCX.js works with JSZip.

Thanks.

@andymav
Copy link

andymav commented Apr 18, 2013

I'll second this request - even just a simple example would go a long way to helping understand how best to use DOCX.js

@lucidtech
Copy link

I'll third the request...

@chanpory
Copy link

Yes, please include a simple example.

@ferndot
Copy link

ferndot commented May 30, 2013

This would be so helpful.

@krokhale
Copy link

krokhale commented Jun 5, 2013

+1!

@gnetsys
Copy link

gnetsys commented Sep 3, 2013

The topic of DOCx to html convertion has be long on going for a few years now and this is excellent work thank for this contribution. I have tested it as well with simple call and could not get the script to function. I would appreciate as well if you could provide a tutorial. Thanks in advance.

@stormcrow85
Copy link

Joining the request.

@alexpls
Copy link

alexpls commented Oct 22, 2013

Count me in on this request, too. I'll try and figure out how to work DOCX.js, if I do I'll make a pull request with a simple readme.

@aloncarmel
Copy link

+1 , i am breaking my head on how to get this to work with no success. i simply dont know what the file object that need to pass the function. i keep getting Corrupted zip : can't find end of central directory

@darsen
Copy link

darsen commented Jan 30, 2014

+1 :)

@mikeg2
Copy link

mikeg2 commented Feb 15, 2014

PLEASE ADD SOME DOCS! Even if you just copy and paste some random code you've used it in into a "demo" folder, it would go a long way. I'm completely lost at what "input" is suppose to be.

@mikeg2
Copy link

mikeg2 commented Feb 15, 2014

Here's a semi-working example. The "input" variable is actually a JSZip object that you have to create first. I REPEAT: YOU HAVE TO UNZIP THE DOCX FILE FIRST! I think that's what is causing the confusion.

@circleb
Copy link

circleb commented Mar 19, 2014

Has any body found any samples yet?

@cmweiss
Copy link

cmweiss commented Apr 3, 2014

I was able to get some imperfect results after I made a couple of small modifications to docx.js. The modifications I made are:
Line 74: changed if (inNode.style.textAlign) {...}; to if ('style' in inNode && 'textAlign' in inNode.style) {...};
Line 132: changed sharedStrings = [[], 0]; to //sharedStrings = [[], 0]; as the sharedStrings variable is referenced nowhere else.
Then...
I was able to get a non-working word document by doing the following:
document.getElementById('docxLink').href = docx({DOM: document.getElementById('content')}).href();

I was able to click my anchor tag with the id of docxLink and download a .docx file but word reported an error and could not open it. After examining the contents of the resulting .docx I saw that there was badly formatted xml in the document.xml (end tags without start tags). You can examine the contents of the .docx if you change the extension to .zip.

You do, of course, need to include JSZip (available here: http://stuk.github.io/jszip/) as it's required by docx.js.

@gnetsys
Copy link

gnetsys commented Apr 3, 2014

Excellent work Christopther

@cmweiss
Copy link

cmweiss commented Apr 3, 2014

The problem with the output .docx is not that there are end tags without start tags as I mentioned above. All of the tags in the document.xml are balanced correctly. I noticed that the document.xml had nested <w:body> tags. I fixed that but still get errors in the document.xml. Perhaps,later, I'll fork this and push my changes even though I'm still not able to create a working .docx.

@herringtown
Copy link

Another +1 for this request. The most recent chatter here (and lack of response from the original author) inclines me to think this project is dead/unusable/broken.

That would be a pity, as this is something that would be really useful. Certainly would be great if someone could conjure up some working demo code or barebones docs!

@chenop
Copy link

chenop commented May 5, 2014

I found this project - and it was a good example for how to use this project:
https://github.com/PinZhang/docx.js-demo

@ZerdaH
Copy link

ZerdaH commented Jun 5, 2014

I tried to have some clear documentation on a fork here, though the methods in the fork are changed quite a bit from the original.

@krokhale
Copy link

krokhale commented Jul 6, 2014

Hi folks, found this great module and i think this might be useful for everyone on this page :

https://github.com/mwilliamson/mammoth.js

@dgbutterworth
Copy link

Thank you krokhale! I'm moving my attention to that project. While this one is interesting, the license agreement is, at best, confusing and, quite possibly, impossible to comply with. My comment on that problem has gone unanswered.

@fr0z3nfyr
Copy link

Why such a crazy license? Esp. "Platform Restriction"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests