Questions tagged [docx]
.docx is the file extension for files created using the default format of Microsoft Word 2007 or higher. Use this tag when you are working with .docx files programmatically, such as generating .docx, extracting data from .docx or editing a .docx
2,837
questions
0
votes
1
answer
22
views
How to extract bold text from docx
I want to extract bold text from word docx using php. I create docx zip file and extract. Then, read document.xml. In xml, presence of <w:b/> show that text is bold.
sample.docx:
Create zip and ...
0
votes
1
answer
32
views
Blank file after using powershell to convert a word file?
I have been trying to use PowerShell to convert some .docx files to .docm. I'm able to convert the file, but it's blank every time I open it.
This is the code I have been using:
Get-ChildItem *.docx | ...
0
votes
0
answers
11
views
Losing MathML when converting from HTML to Docx using LibreOffice
I am using LibreOffice to convert a .docx file to an XHTML file. Mathematics is converted to MathML.
My plan is to use LibreOffice in headless mode (or tools based on it) to convert back the XHTML ...
0
votes
0
answers
15
views
docx4j: help converting XHTML with MathML
I am using docx4j-ImportXHTML to convert XHTML word files. Now I want to add math (equations) support. I know that I need to include an XSL stylesheet to convert MathML to OMML but I am lost on how to ...
1
vote
0
answers
19
views
finding a way to convert a nodebuffer docx to pdf
I am trying to convert my generated docx document to pdf using docx to pdf package https://www.npmjs.com/package/docx-pdf and I keep getting a Process exited with code 2 error. My docx document was ...
0
votes
1
answer
40
views
Delete a variable number of lines in a Word table
BACKGROUND: My daughter works as a Special Needs instructor for a very large school district (with overwhelmed IT especially at the start of the new school year) and has an untouchable/unreachable ...
0
votes
0
answers
22
views
Parsing docx with python
I am trying to convert docx in to text using python pypandoc
output = pypandoc.convert_file(filepath, 'plain', outputfile="/content/cleaned2/"+name+".txt")
but in some of the ...
0
votes
0
answers
27
views
How to add XWPFParagraph in the first page of a document?
I have an existing document (in byte array) that I parsed into XWPFDocument using
InputStream is = new ByteArrayInputStream(docuByte);
XWPFDocument docx = new XWPFDocument(OPCPackage.open(is));
This ...
0
votes
0
answers
25
views
How can i change the font of a specific string in python tkinter
How can I change the font of as specific string from my word project.
The string that its fond needs to change its "paragraph = doc.add_paragraph('NOTIFICARE')".
doc = docx.Document()
root =...
0
votes
1
answer
24
views
While updating .docx file using docx4j, Read only fields become editable
In my docx file we have some readonly fields but, While i'm updating docx file using docx4j library that read only fields become editable.
XML Block
In document we have some section and readonly ...
0
votes
1
answer
28
views
new line \n not registered when generating docx with js
I have javascript code to generate a docx document. This js code creates a Paragraph. With TextRun() I am adding text inside this paragraph:
new docx.Paragraph({
style: "text",
...
1
vote
1
answer
71
views
I'm trying to extract emails, and I'm getting a TypeError
I'm attempting to take emails from 500 word documents, and use findall to extract them into excel. This is the code I have so far:
import pandas as pd
from docx.api import Document
import os
import re
...
0
votes
1
answer
24
views
How do I extract tables from word via table titles?
I'm facing the problem of trying to extract data from word files in the form of tables. I have to iterate through 500 word files and extract a specific table in each file, but the table appears at a ...
0
votes
0
answers
24
views
Errors when extracting table, what am I doing wrong? Python
I'm trying to extract the 8th table in a word document. This is what I have produced so far:
import pandas as pd
from docx.api import Document
import os
os.chdir('C:\\Users\\user1\\')
path = 'C:\\...
2
votes
0
answers
35
views
PYTHON - Extract specific table from word document of tables, and display in excel
I'm trying to extract the 8th table from 500 word documents, and then put them into one page on an excel document, retaining the columns.
import pandas as pd
from docx.api import Document
path = 'C:\\...
0
votes
0
answers
28
views
How to determine the height of a row using Python Docx when set by text
I'm using the python-docx module for Python and am trying to determine the height of a row.
table._Row.height returns None as the row height is determined by the text in the cell of the row. Each row ...
0
votes
0
answers
20
views
Subset of docx Document in python
with the docx library of python I read a document, which consists of paragraphs, where each paragraph itself consists of different runs.
The document is created by doc = docx.Document("some_pages....
0
votes
0
answers
26
views
How to convert HTML table to Pandas dataframe that has repeating rows which span across all columns?
I have a word docx that has a table that I need to convert to a pandas data frame for some more analysis.
The table is mostly clean except that there's re-occuring rows that span across all of the ...
0
votes
1
answer
43
views
How to extract text with hyperlinks from docx file with python?
The docx file that i am working on has a hyperlink with a comment on it.
For eg:
https://www.someurl.com/ddoai9101?%20dsadoi - File with student address
https://www.someurl.com/ddoai9101?%2a1231w1 - ...
1
vote
2
answers
72
views
Converting RTF Files to DOCX and PDF Files on Python-Django and linux server
Is there any way to accurately convert RTF Files to PDF and DOC files on linux server with Python ? I have gone through a number of past questions and here is what I concluded :
The libreoffice ...
0
votes
0
answers
22
views
Extract DOCX comments and reference text with Python
Is there a way to extract the comment content and the referenced text without using COM? I provided a working solution below, but looking to do this without COM.
The solution below was provided by ...
0
votes
0
answers
13
views
convert a docx file into pdf file using unoconv
convert a docx file into pdf file using unoconv. It's taking too long to convert as pdf and aborted
DOCX to pdf conversion command:
unoconv -f pdf -o sample.pdf sample.docx
Download the sammple docx ...
0
votes
0
answers
21
views
Generate and download a file .doxc in flutter web with docx_template: ^0.3.3
i´m trying generate and download a file .docx generated with docx_template: ^0.3.3, actually i have this (generate):
final d = await docx.generate(c);
//Get external storage directory
//final ...
0
votes
0
answers
15
views
convert a docx file into pdf file using unoconv. It's taking too long and aborted
convert a docx file into pdf file using unoconv. It's taking too long and aborted
DOCX to pdf conversion command:
unoconv -f pdf -o sample.pdf sample.docx
Download the sammple docx file
0
votes
0
answers
29
views
Pandoc: 'The picture can't be displayed' error shown for some images in .docx file after converting from .md
I'm trying to convert our Git Wiki from .md to .docx files and some images are not displayed in the resulting Word file. It seems that whether the image will be shown depends on the URL and not the ...
0
votes
0
answers
25
views
Python docx content unreadable in terminal
I want to print out contents of a docx file to my terminal using python. However when I use print(contents) I get a unreadable string:
PK♥♦¶!gs(/�☺( ☻[Content_Types].xml �♦☻(�☻Ė�j�0►E����Ѷ�JR(
I ...
0
votes
0
answers
24
views
Insert a image inside another image using the DocX Library
I would like that the user insert a image inside of a Gowin's V in word using the DocX Library. The problem is that I don't find anything about insert a image inside another image.
An example I would ...
-1
votes
0
answers
19
views
Convert docx to html into node.js and Angular [duplicate]
Today I have started a new project where I am using node js for backend and Angular for frontend. In this application have a option for display the docx file information into HTML. I am using mammoth ...
0
votes
1
answer
13
views
Python docx: standard table styles unavailable
A similar problem has been addressed here but in my case the situation is different. I want to create a table with border lines, however no reasonable style can be used. Running
table = doc....
0
votes
0
answers
21
views
how to call blob object as file to the asp.net MVC Controller
I successfully downloaded the file with the help of filesaver.js.
var out = doc.getZip().generate({
type: "blob",
mimeType: "application/vnd.openxmlformats-officedocument....
1
vote
0
answers
23
views
I am unable to parse through the corrections in the words document through the docx library
I have been trying to parse through the text document, which is a compared document and i want to extract the text in the document which was corrected, which is distinguished by the strike on the ...
0
votes
1
answer
73
views
How to convert docx to pdf file in flutter?
I'm trying to convert a docx file that I made with the docx_template library: ^0.3.3 to PDF, I've tried using libraries to do it. Whit SyncFusion i have this:
//Get external storage directory
...
0
votes
0
answers
25
views
How to prevent adding an empty line before the top of a newly added paragraph?
I need help with using the docx library for Python 3.
I am creating a new paragraph. When I add new text, it adds a new empty line on top of the paragraph.
row = table.rows[0].cells
fullNameIntro = ...
0
votes
1
answer
39
views
Python docx module to modify multiple files
I am trying to use small, nested for-loops to iterate through a list of values, replace items in a Word doc with the docx module, changing one value each loop, and saving a new doc each time and ...
0
votes
0
answers
63
views
export html to docx in react
How can we export html content to docx in react js?
I need to export html content to docx using react. I have used html-to-docx library but I can export the docx to locally running application only. ...
0
votes
0
answers
31
views
Table Rows are to high when converting with Docx4j
i am currently trying to convert XHTML to Docx with Docx4j.
I figured everything out but the table-row-height or the spacing of it is not ok - it always get spacing after the text. At the moment this ...
1
vote
0
answers
26
views
Unable to set docx table column width using python-docx module
I have the following code. But when I open copy.docx in Word the table column width is still the original value of 5.25 cm. What am I missing here?
import docx
import docx.shared
colw = docx.shared....
0
votes
0
answers
21
views
Iterating over rows in Python using docx
I've written a script to change the vertical alignment in all cells for a row (2) to center.
My solution works, see the script below, but I think it's rather clunky by getting the number of rows, ...
0
votes
1
answer
32
views
How to handle new line to a single paragraph python docx
I have a problem when extracting the .docx file from Microsoft Word. I want to handle the data extracted by using python-docx library. When I want to scrap the file. I have a problem that a single ...
0
votes
1
answer
36
views
How to upgrade the docx format to the latest by docx?
👉The original file is docx format, which has multiple tables, but there may be format problems, so it cannot be read by python-docx.
✔️ 1.Solution by hand:
solve the question by click [save as ....]...
0
votes
0
answers
13
views
python-docx Bilingual Document RTL and LTR
I want to create a bilingual MS word document; containing English and Arabic text.
As you may know, Arabic is an RTL language (written from right to left).
My most difficult problem was solved, Arabic ...
0
votes
1
answer
32
views
OpenXML Copy Everything from two Docx templates into a single Docx File C#
We have two Docx files, one having the header templates(Letter Head) with Header and Footer parts and the title and the second file have the body. We need to combine both the Docx files into a single ...
0
votes
0
answers
18
views
python docx catch text before and after a table - scan content of a doc in its order
I have this document with multiple tables in it.
I am creating a single docx file for each table found in the original document with the code
import pandas as pd
from docx.api import Document
...
0
votes
1
answer
28
views
How to put docx in JSZIP
I have no way to insert docx/rtf into a zip folder. I am using React TypeScript JSZip docx.
It seems to me that the problem is that I can't convert the File type to Blob type.
I'm making a word file ...
0
votes
0
answers
44
views
How to get the shapes in a docx drawing using XWPF (Apache POI)
I have a docx document with text and some shapes. I am able to get the drawings, but when I get a drawing, how can I get the Shapes in this drawing? For example I have the following code to parse my ...
0
votes
0
answers
45
views
How to convert docx to pdf and show hypen
How to convert docx to pdf sing poi and itext pdf. actually if i convert, hyphen not show. i want to show hyphen.
public class DocxPdf {
public void convert (String inputfile, String outputfile) ...
0
votes
0
answers
45
views
Using pypandoc.convert_file from docx to txt - how to prevent text wrapping in table columns?
I am using pypandoc to convert docx files to txt:
f = 'some file.docx'
o = pypandoc.convert_file(f, 'plain', outputfile='file.txt')
assert o == '', o
The problem is that the result is best fitted for ...
0
votes
1
answer
27
views
How to export a complex element in a doc showing just a property and keeping all other information?
I need to import and export some documents from my web app written in .net-core to docx and viceversa: the users should be able to export, modify offline, and import back. Currently I am using OpenXml-...
1
vote
1
answer
39
views
how do I write this style command as a key to fix this error?
Can anyone tell me how to fix this?
table = document.add_table(rows=1, cols=3)
table.style = 'LightShading-Accent6'
for i in range(3):
table.rows[0].cells[i].text = table_header[i]
I am getting ...
0
votes
1
answer
57
views
How to convert docx to pdf use java (korea)
I try convert docx to pdf.
Docx file has korean
maybe you think BTS song's lyrics
Eg.
Friends
BTS
유난히도 반짝였던 서울!
처음 보는 또 다른 세상
땀에 잔뜩 밴 채 만난 넌
뭔가 이상했었던 아이
난 달에서, 넌 별에서
우리 대화는 숙제 같았지
하루는 베프, 하루는 웬수
I ...