Comments (8)
Do you have a test/public version of this .doc file you could share with me, then I can take a look? You send directly to [email protected] if you prefer.
from node-word-extractor.
thank you! i have sent two mails to you,the second one is my project.
from node-word-extractor.
Got the file. This is... interesting. I'm not getting the same error, and I am getting text out which visually matches the document. But there's some weird character-level stuff there too, which broke a test or two. So I'm going to dig at it.
What version of Node.js are you using? I'm suspicious there might be a Unicode type issue at play, and that has changed a bit across versions.
Haven't tried Windows yet, as that might be a factor too. I'll check that tomorrow.
from node-word-extractor.
OS:win 10
node:v4.4.7
the file contains chinese,it may be the reason of the weird character-level stuff.
thank you ,good night.
from node-word-extractor.
Ah, OK. I think this is a major documentation error. As far as I can tell, the WordExtractor#extract
method returns a promise that resolves to a document, rather than a document.
I can't see how I didn't document this in the README.md (which I clearly didn't), because it looks like it was always this way, and the unit tests certainly work that way.
However, it does make sense, as otherwise it'd be blocking on I/O, and that's not good.
So try something along the lines of...
var WordExtractor = require("word-extractor");
var extractor = new WordExtractor();
var pd = extractor.extract("./testDocccccc.doc");
pd.then(function(doc) {
console.log(doc.getBody);
});
Can you see if this works for you, and if so I'll amend the docs. The test files are a good place to look for examples, although expect
obfuscates it a little.
And I'm truly sorry.
from node-word-extractor.
I'm sorry for replying you so late,we have a meeting all day.it is a good news for what you find.
i did the test just now,
and ''console.log(doc.getBody());'' missing brackets after getBody.
console output: This is a test for parsing the Word file in node.
sure,it works.
but the chinese in the files can't read successfully,my true files are all in chinese,could you help for that?
whatever,thank you very much!
from node-word-extractor.
Ah,it works for chinese,but change the position of paragraph, leading to the formation of text missing words.
from node-word-extractor.
Good for finding this. If you can make enough of a test case that I can get it, I'd be happy to look into this. It's very possible, given that the encodings used inside both Word and JavaScript are neither especially standard, and there could well be issues that have fallen in between.
I'd be happy to fix if you can find a small enough test file that I can understand, although it might be best flagging that as a new issue, and I'll use this to fix the docs
from node-word-extractor.
Related Issues (20)
- Use word-extractor in typescript HOT 1
- Get body function getting logged HOT 1
- Incorrect text when extracting fields
- Incorrect character filtering for Word
- Handle field displayed text right in OLE Word
- Correctly remove deleted text HOT 1
- Table rows are not terminated correctly in OLE files HOT 1
- Separate header and footer HOT 8
- add method to read text boxes HOT 7
- Error: Max buffer length exceeded: attribValue HOT 10
- Errors thrown by the XML parser cannot be caught HOT 1
- Switch the SAX layer to saxes HOT 1
- WordExtractor get_body() doesn't appear to retrieve all text content from .doc file HOT 8
- WordExtractor get_body() doesn't appear to retrieve all text content from .docx file HOT 1
- error
- Add a way to detect Numbering indicator/ Bullet point HOT 12
- Add a way to read macros HOT 1
- Any way to read data from url
- Add way to iterate, fetch, and count pages HOT 1
- Broken multi-byte letters at the borders of 4096-byte chunks HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from node-word-extractor.