Problems with Rich Text Format files with spaces in their filenames
agrimm opened this issue · 5 comments
agrimm commented
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 commented
This on Mac, ya?
dbashford commented
There is a test that specifically handles rtfs with spaces in the name, is that test working for you?
dbashford commented
nevermind, reproduced and fixed, thanks!
dbashford commented
Published with textract 2.1
agrimm commented
Thank you!