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

Problems with Rich Text Format files with spaces in their filenames #109

Closed
agrimm opened this issue Dec 23, 2016 · 5 comments
Closed

Problems with Rich Text Format files with spaces in their filenames #109

agrimm opened this issue Dec 23, 2016 · 5 comments

Comments

@agrimm
Copy link
Contributor

agrimm commented Dec 23, 2016

If there is a space in the value for filePath, then it can't extract from a Rich Text Format file:

var textract = require('textract');
var path = require('path')
  , fs = require("fs")
  ;

var config = {};
config.preserveLineBreaks = true;

var processText = function (error, text) {
  console.log(text);
};

var filePath = "Example filename.rtf";
// Works if the following is used
// var filePath = "ExampleFilename.rtf";

textract.fromFileWithPath(filePath, config, processText);
// Also works if the following is used
// var textBuff = fs.readFileSync(filePath);
// textract.fromBufferWithName(filePath, textBuff, config, processText);

However, if the filePath is changed to not have a space in it, or if fromBufferWithName is used, it works fine.

This is using the 2.0.0 release of textract.

@dbashford
Copy link
Owner

This on Mac, ya?

@dbashford
Copy link
Owner

There is a test that specifically handles rtfs with spaces in the name, is that test working for you?

@dbashford
Copy link
Owner

nevermind, reproduced and fixed, thanks!

@dbashford
Copy link
Owner

Published with textract 2.1

@agrimm
Copy link
Contributor Author

agrimm commented Dec 24, 2016

Thank you!

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

2 participants