1

I am trying to fetch the doc file text using "textract" npm module but for this I have to install one of its dependency "antiword" on heroku

The command I used to install it was:

 heroku buildpacks:add https://github.com/ropensci/antiword.git

But antiword is throwing error at the time of extracting text from doc file

error is Error: antiword read of file named [[ 1619419536356test.doc ]] failed: Error: Command failed: antiword -m UTF-8.txt "/app/public/user_files/1619419536356test.doc"
2021-04-26T06:45:38.048275+00:00 app[web.1]: I can't open your mapping file (UTF-8.txt)
2021-04-26T06:45:38.048276+00:00 app[web.1]: It is not in '/app/.antiword' nor in '/usr/share/antiword'.
2021-04-26T06:45:38.048277+00:00 app[web.1]: Name: antiword
vivek sharma
  • 251
  • 3
  • 11

1 Answers1

0

Antiword is trying to find specific files in /app/.antiword which happens to be the location of your repo. I ended up just manually adding those files.

  1. At the root directory of your repo, add a folder named .antiword
  2. From the Antiword Repo, download the contents of the Resources folder and move them into your .antiword folder
  3. Commit and push your repo to Heroku with the new folder
Egg Salad
  • 1
  • 1