Questions tagged [mammoth]
35 questions
1
vote
2 answers
Node.js document word count output in a element id
I am having tough time with this code that should read a microsoft word's document file and output the number of words into a div element.
I tried everything and the code outputs the number of word into console but not in the div. Please help me…

Aguntuk Rahman
- 11
- 4
1
vote
1 answer
Package convert from .doc to html
I am using mammoth npm package to convert docx to html, but it is not usable for doc files.
So which package to use to convert doc files? I have searched many but not found.
I am using nodejs.

Đô Nguyễn
- 47
- 9
1
vote
3 answers
EXCEPTION: mammoth is not defined
I am trying to integrate mammoth npm library with meteor.
When using the import command,
import { mammoth } from "mammoth"; was getting
Uncaught TypeError: Cannot read property 'bind' of undefined
When using the command,
declare var mammoth: any;…

ARUN DAVID JOHNSON
- 85
- 5
- 13
0
votes
0 answers
Mammoth usage in Angular/Typescript project
I tried to use mammoth for extracting text from word files in my Angular project. But it won't work. It gives error:
path.js:25 Uncaught ReferenceError: process is not defined
at 4943 (path.js:25:17)
at __webpack_require__ (bootstrap:19:1)
…

Marcin
- 25
- 4
0
votes
0 answers
Keeping font sizes when converting DOCX to HTML using mammoth
I have the following code that converts DOCX to HTML:
style_map = """
u => u
"""
f = open(file + ".docx", 'rb')
b = open(file + '.html', 'wb')
document = mammoth.convert_to_html(f, style_map=style_map)
html =…

gtomer
- 5,643
- 1
- 10
- 21
0
votes
1 answer
Is there a way to convert .doc file to HTML in Mammothjs?
I'm using Mammothjs to convert docx file to html in ReactJs and it works perfectly. However, it's currently not supporting doc files. Is there any way or any alternative to convert doc files to HTML? TIA

Minh Quang Lê
- 21
- 7
0
votes
1 answer
Using Mammoth style_map to apply inline styles and custom attributes
I'd like to use Mammoth's style map to apply inline styles, like color:red and custom tags/attributes, though I cannot seem to find anything in the docs that suggest I can. Does mammoth have the capability to do inline styling?
Simple tags and…

Peter
- 1,065
- 14
- 29
0
votes
0 answers
To read ms word file table in html form
CODE A
I uploaded doc using multer and stored it in './data/documentUploads/' folder.
then I used mammoth and cheerio library to read it in html form.
here is code
xmlReader.getLibraryHTML = async docxFileName =>
new Promise((resolve, reject) =>…

Vishal Tanawade
- 21
- 5
0
votes
0 answers
Convert docx to html using mammoth and html to docx using html-docx-js by node js giving error
last few days I am fetching problem with my project when I am converting docx to html and after edit the html with angular editor I am saving the html into docx file again. I am using the following npm module below for converting.
Convert docx to…

Al Imran
- 115
- 1
- 2
- 12
0
votes
0 answers
formatting html converted from docx when using python-docx and mammoth
I've tried to convert docx file to html by using python libraries docx and mammoth.
I've achieved to convert a file from docx to html at basic level.
However, I couldn't find a way to properly take the docx elements style like alignment, color or…

selimhan
- 13
- 4
0
votes
2 answers
Return a promise in a node.js module
I want to return the data once it has been processed by convertToHtml, but it just return the data before the converting process is over. Any suggestions on how to implement it?
exports.extractData = async function(path) {
var mammoth =…

Gonzalo
- 349
- 2
- 5
- 16
0
votes
1 answer
Python Writing huge string in text file with a new line character every 240 characters
I need to convert a word document into html code and then save it into a .txt file with lines of no longer than 100 characters (there's a process later on that won't pick up more than 255 characters if they're not in separate lines).
So far, I've…

Javi Torre
- 724
- 8
- 23
0
votes
0 answers
i want to convert docx to multipage html in java
i want to convert word document file to Html in java with page separation. it is already working with mammoth in java but output Html comes only one page.

Murali Krishna
- 11
- 4
0
votes
1 answer
Python convert docx to html using mammoth: html, head and body tag missing
I am trying to convert a simple docx file into HTML file using mammoth package. But it seems that the generated html contains only part of a full HTML file: the HTML, head, and body tags are all missing in the generated html string.
I wonder if…

jdhao
- 24,001
- 18
- 134
- 273
0
votes
1 answer
cannot access the files in my express route
I'm trying to do the following:
upload a doc file to the a specific express route,
and then use mammoth to parse it to an html object,
this is the library: https://www.npmjs.com/package/mammoth
My problem is that it takes the file in the…

Alexander
- 1,288
- 5
- 19
- 38