Questions tagged [mammoth]

35 questions
4
votes
3 answers

How to extract text from docx file with Nodejs

i want to extract text from docx file, i have tried using mammoth var mammoth = require("mammoth"); mammoth.extractRawText({path: "./doc.docx"}) .then(function(result){ var text = result.value; // The raw text //this prints all…
ankitkhandelwal185
  • 1,023
  • 1
  • 15
  • 24
3
votes
0 answers

How to parse a .docx file which contains Math Equation using Node.js?

To be brief, I'm trying to parse some .docx word files which have Math equations inside and that's where the problem begins! I want to use Node.js to parse the whole document including all texts, images, and those Math Equations, no matter if I…
3
votes
4 answers

Cannot convert DOCX to HTML with Python

I've tried it by using mammoth: import mammoth result = mammoth.convert_to_html("MyDocument.docx") print (result.value) I don't get an HTML, but this strange…
yisus
  • 125
  • 1
  • 7
2
votes
0 answers

python - convert docx to HTML including Fonts and Fonts Size

I'm trying to convert a file from Docx to HTML with font family, fonts size and colors in Python, I tried couple of solutions i.e Python docx, docx2html, Python Mammoth. but none of the packages works for me. these packages are converting to HTML,…
1
vote
0 answers

How to configure mammoth library in Angular project which is made with Angular CLI and uses webpack 5

I need a functionality that can convert uploaded file (mostly .docx) content to HTML code. I thought of using the "mammoth" library. I can't seem to configure my project so that it can use the "mammoth". Does anybody know what should I do to make it…
1
vote
1 answer

Mammoth/Angular ERROR Error: Could not find file in options when converting docx

It's probably a stupid question but i'm using mammoth to convert docx files to html in Angular (10). I'm choosing the file through an input and converting it to an array buffer when a button is pressed then I send it to mammoth to be…
lou habert
  • 186
  • 1
  • 1
  • 18
1
vote
0 answers

How to export .docx style_map to mammoth python and embed?

I have a .docx document that I am trying to convert to html. It has some custom styles. Can the styles be exported to mammoth or embedded with the word document directly (word ui)? I did see some comments about using python-docx to export style to…
Itay Livni
  • 2,143
  • 24
  • 38
1
vote
1 answer

Python Mammoth Strange elements within HTML headings

I just found the Mammoth Python package a couple of days ago and its a great tool which really creates clean HTML code from a Word doc. Its nearly perfect. There is just one artifact I don’t understand. The heading elements (h1-h6) it creates from…
Peter Ebel
  • 11
  • 2
1
vote
0 answers

How to format / add custom CSS to the HTML using Mammoth JS

I m using mammoth js https://github.com/mwilliamson/mammoth.js to convert docs file to HTML this was working fine but i m not getting exactly copy the styling (font, text size, color, etc.). How to format the css style exactly? var options = { …
Gouda P
  • 126
  • 8
1
vote
1 answer

How can i convert .odt file to html using python

In windows, document file ends with .docx To convert the content of .docx file to HTML string, i used mammoth package and everything works perfectly. Now i face with .odt file in Unix system, which is using LibreOffice. The problem is: Is there any…
Quang Thái
  • 649
  • 5
  • 17
1
vote
1 answer

Python mammoth error: zipfile.BadZipFile: File is not a zip file

My code is ran in Python 3.8.2, name of file is main.py After I run python main.py, i receive the error like this: My path to file is : C:\Users\84165\Desktop\KLTN-backend\upload\thainq\Test.docx I have searched in stackoverflow for hours about…
Quang Thái
  • 649
  • 5
  • 17
1
vote
1 answer

How to apply a function from node package to all the files in a directory?

I've installed mammoth.js module which converts docx to html. I can use it with a single file. How do I use the same module for all the files in a specific folder? I'm trying to save an output html files while keeping the original name (not the…
A. Howe
  • 57
  • 6
1
vote
1 answer

Mammoth not finding any modules

I am trying to create a Word to HTML converter, and I am trying to use Mammoth as a framework. Whenever I run my script, I get: Internal/modules/cjs/loader.js:983 throw err; ^ Error: Cannot find module 'mammoth' Require stack: -…
1
vote
0 answers

how to find an element in mammoth module object in python

import mammoth Docx = open(r'D:\python\temp\sampletable.docx', 'rb') document = mammoth.convert_to_html(Docx) E.g. I want to find element in document object
1
vote
1 answer

Converting .docx file to html file with same name as .docx using mammoth

I have a code to convert (.doc) to HTML file. The code is: import mammoth f=open("c: ......\\demo.docx","rb") b=open("ABC.html","wb") document=mammoth.convert_to_html(f) b.write(document.value.encode('utf8')) Now ABC.html will be created.…
1
2 3