3,124 questions
0
votes
0
answers
7
views
In node js docx library im trying to generate a word document. if i change PageMargin, the headers and footers also got affected by it.what to do?
enter image description here
sections: [{
properties: {
page: {
margin: { top: 0, // 1 inch
left: 1440, // 2 inches (shifts content right)
right: 1440, // 1 inch (affects ...
0
votes
0
answers
13
views
Python-docx Package non-XML characters issue
I built a web app in Python and Flask that uses python-docx to parse Word documents, send the text content in JSON format to an AI to be proofread, and then sends the content back to be reassembled ...
0
votes
0
answers
27
views
How to ensure images do not overflow in docx files when adding images in docx file using docx4j by embedding alt chunk?
When an image is added to HTML as an img tag and this HTML is then embedded into a docx file using docx4j as altchunk. The image overflows the docx page boundaries as shown here:
I tried adding max-...
-1
votes
0
answers
29
views
How to convert String with newline and tabs to nested bullets in word docx using python-docx [duplicate]
Convert a markdown LLM generated text to suitable word supported bullet/sub-bullet format.
Currently we are trying to convert a LLM generated multibullet and subbullet text into a word bullet.
The ...
0
votes
0
answers
21
views
.add_run().add_picture() not adding picture
I have this code that trying to generate a word document. I have the document working except the image adding. When I try to add a run, the image doesn't show up. When I try to add a picture to the ...
0
votes
0
answers
10
views
how to use 2 dynamic lists in same docx using opentbs
I have 2 dynamic lists with the same number of columns but different number of rows.
Accessing the first table is easy as I address the table with [a.field] and it shows all the necessary data ...
0
votes
0
answers
37
views
using docx to replace placeholders for a standardized report
I am trying to change a project report to a template. However, not all placeholders work. Here is the sample text I am trying to replace:
The section of the template I have trouble replacing
Here is ...
1
vote
1
answer
42
views
Flutter docx_template removes tab spaces when replacing placeholders
I'm using the docx_template: ^0.4.0 package in my Flutter app to replace placeholders in a .docx file while preserving the original format. The issue is that tab spaces between fields are getting ...
0
votes
0
answers
48
views
R: Is there a way to add gt tables to a docx document, while maintaining format and gtExtras elements (e.g., sparklines) and added images?
I am trying to output a few gt tables to a word document. The tables include sparklines (from gtExtras gt_plt_sparklines).
Sample code I use:
library(data.table)
library(gt)
library(tibble)
library(...
0
votes
0
answers
17
views
quarto ignoring gt column widths when converting to docx
I am trying to make a set of tables in quarto to export into a docx file.
The following code outputs a table when you render but it ignores the space formatting applied.
Any idea how to work around ...
0
votes
1
answer
92
views
Why I can't extend the lifetime of the variable of my function? [closed]
I am trying to use crate docx_rust to merge a list of Word documents into one. I try this but I am having a lifetime problem with doc because it's dropped at the end of the for loop.
use docx_rust::{...
0
votes
0
answers
47
views
How to edit/change every hyperlink in a word document with python-docx or some other library?
I have been trying to re-link a .docx file that contains many hyperlinks embedded inside text sections since we decided to change document storage services. So the links on the docx are old and need ...
0
votes
0
answers
20
views
How to remove default formatting(indents and line spacing) when using docx4j `mainDocumentPart.convertAltChunks()`?
When using a HTML content string, embedded as a altchunk in docx using docx4j, and converted to docx elements using mainDocumentPart.convertAltChunks(), by default there is some indentation and line ...
0
votes
0
answers
25
views
How to remove additional line breaks rendered in docx from `br` tags when using docx4j `mainDocumentPart.convertAltChunks()`?
When using HTML string having line breaks(br tags) and using mainDocumentPart.convertAltChunks() method of docx4j (v 8.3.11), empty lines/line breaks are more than the number of br tags which should ...
1
vote
1
answer
95
views
OnlyOffice Docs: The DocumentEditor is not saving changes in Next.js
I have configured the Docs editor in my Django project as the backend and it returns the config object to my Nextjs 14 app.
When I try to load the Docs editor, it loads fine but the saving ...
1
vote
1
answer
74
views
How to fix custom font-size added as inline HTML style in docx file generated using DOCX4J when embedding HTML content as altchunk?
Using docx4j java libraries, when trying to generate a docx file having a HTML string embedded in docx file as altchunk the inline font-size formatting does not work as expected. When font-size is set ...
-3
votes
1
answer
67
views
Extract numbering from custom list style in .docx using Python
I have documents which I need to examine in Python and from which I must extract certain information. The documents contain two tables: findings and recommendations. The first column in these outlines ...
0
votes
0
answers
23
views
How do I use MergeDataLoader to tolerate multiple files that could be in either PDF or docx format?
I am writing a RAG chatbot that retrieves information from a given list of documents. The documents can be found in a set folder, and they could be either .pdf or .docx. I want to merge all the ...
0
votes
0
answers
29
views
Converting OOXML to Docx using python on Linux
Unfortunately, as much as I know libreoffice cannot convert an ooxml to docx,
I need to accomplish that on a linux server.
I tried manually converting the xml file into a zipped docx structure but ...
0
votes
1
answer
38
views
Manually Copying Chart from Docx to Another Results in Corrupted File
I'm working on a requirement to copy content from a docx file and append it to another, but the mess starts when it comes to charts.
I'm using python-docx, and since it does not support charts ...
1
vote
1
answer
144
views
The image showing in docx file is not visible in pdf when converted using unoconv
The image showing in docx file is not visible in pdf when converted using unoconv where the image is displayed using
$document = new \PhpOffice\PhpWord1\TemplateProcessor($docx_temp_file_path);
$...
0
votes
1
answer
65
views
Using DocumentFormat.OpenXml in C# .NET to make an entire DOCX italic
Using C# / .NET and the DocumentFormat.OpenXml Nuget package by Microsoft, I'm trying to modify DOCX files so that the entire document is formatted as italic.
However, the output document is much ...
-1
votes
1
answer
43
views
How to add footnotes to a docx file using docx4j library?
I am trying to create a new docx file and add footnotes to it using docx4j library in Java.
I only want to use docx4j library. I could not found any sample implementation given by the docx4j library ...
0
votes
1
answer
120
views
Converting Document Docx with Comments to markit using markitdown
There is a new open source python library from Microsoft markitdown https://github.com/microsoft/markitdown
It basically works fine on my Docx documents (if anyone uses it, make sure you use it on ...
0
votes
0
answers
25
views
Applying proper paragraph formatting in Word document using Python
I am automating a Word document generation and I would like for it to apply common paragraph formatting. I have used this piece of code to achieve that:
if paragraph.style.name.startswith('Heading'):
...
0
votes
0
answers
21
views
C# Microsoft Word document on the automation of inserting charts
Process: According to a template word, then there are many bookmarks in it, and each bookmark needs to be inserted into a different chart (editable chart, not image). But this template has hundreds of ...
1
vote
0
answers
44
views
How do I use php to add custom properties to docx
I am trying to prepare a docx template file with pre-inserted custom properties (Quick Part -> Fields) from a database. The file starts as an empty docx file created in MS Word.
I reviewed this ...
0
votes
0
answers
27
views
PyInstaller can't find docx module
I have a python program I wrote to parse through student data from powerschool and automatically generate a letter with their missing assignments to send to their parents. This program works great, ...
0
votes
0
answers
36
views
How to include unordered list inside a Quarto - Huxtable cell for Docx output?
I am trying to produce tables in which some cells contain unordered lists. I am trying to output to docx.
I tried the regular qmd tables, and flextable, and now I am in Huxtable.
The reason I chose to ...
0
votes
0
answers
18
views
docx openxml file format, and rendering lists special cases
I have had a look at this article The MSDN article Working with Numbered Lists in Open XML WordprocessingML discusses the issue in detail
it describes how to render lists inside of a docx file, but in ...
0
votes
0
answers
34
views
NPOI Word Document Setting Header Top Margin
I am using NPOI for docx files. Here is my simple code block.
using (FileStream wordFile = new FileStream("C:\\User\\Desktop\\wordtest\\testword.docx", FileMode.Open, FileAccess.Read))
...
0
votes
0
answers
29
views
How to convert snippets of a word file into HTML in the browser using Mammoth (or another library)?
I have the following snippet of a word document (as XML)
<w:p xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main" xmlns:w14="http://schemas.microsoft.com/office/...
0
votes
1
answer
43
views
How can I merge table column cells in a .docx table created using Apache POI
I am trying to merge cells in a generated table to have the effect displayed in the image.
How can I merge cells for this purpose in a Java application that uses Apache POI to generate a .docx file? ...
0
votes
1
answer
47
views
How to add a section before the table contents when converting markdown to docx?
I am trying to add a section before the table of contents in a docx generated from a markdown file. My table of content is generated with the --toc option of the pandoc command and my
markdown does ...
-1
votes
1
answer
66
views
Creating a docx file with a specific text in flutter/dart
I have a string which i want to add to an empty word document. I want to create a new word docx and add that string to it and be able to share it as well.
Code:
static Future<void> createDocx(...
0
votes
0
answers
42
views
Inserting images into a .docx file in Python
There is a task of generating reports in docx from PDF, I can not defeat the insertion of an image. The image needs to be inserted with specific parameters. Problems arose with the position and text ...
0
votes
0
answers
34
views
Header and Footer in main Body
So basically I am trying to generate html from docx using openxml powertools. It handles whole thing except header and footer. I have file name main.docx, I am trying to create temporary docx file for ...
0
votes
0
answers
44
views
Document Footers Generated by WordprocessingDocument don't display the same on Word
I have been using the WordprocessingDocument to generate Word Document for a long time at this point and have not faced this issue till now. However, it is more prominent and gets worse when using ...
1
vote
0
answers
31
views
How can I set the width of cells in a table using the docx library for Node.js?
I’m generating a .docx file using Node.js. In my header, I have a table that contains one row and two cells. The table spans the full width, and I’m trying to set the width of the cells as follows:
...
1
vote
0
answers
50
views
How find information in adjacent cells merge cell docx document with Python
I'm using the python-docx library to extract data from a MS Word document.
More precisely, I'm trying to find and merge cells in tables, extract the content of the found cell, and register it as the ...
0
votes
0
answers
47
views
Issue with Table and Figure Captions Disappearing when Converting AsciiDoc to DOCX using Asciidoctor
I'm encountering an issue when creating captions for tables and figures in AsciiDoc. I’m using :table-caption: and :figure-caption: to automatically generate numbered captions for tables and images in ...
0
votes
0
answers
24
views
Deleting images and tables that aren't under an specific Heading with python-docx
I have to change a lot of docx documents. I need to strip some content and only leave the relevant one.
All docx files have the same structure, I need to keep text, images and tables under certain ...
0
votes
0
answers
68
views
How to extract page numbers when using Azure Form Recognizer with DOCX files? [duplicate]
I am currently using Azure Form Recognizer to process DOCX files, but I've encountered an issue that I need help with. Unlike when I process PDF files, where I can extract text along with the ...
0
votes
1
answer
72
views
Path_To_Connection Error when reading in Docx file to R with Officer and Docxtractor
I have several hundred documents from a legal database in ".docx" format. I am trying to do some NLP work on the docs, but can't seem to get past 0. Don't want to post the test doc because ...
2
votes
0
answers
49
views
Microsoft Graph DOCX to PDF not processing fields, is there a way?
When opening the DOCX locally (Word), then saving it to PDF, all fields get processed/updated automatically and the PDF generated is correct.
When using Microsoft Graph API to convert the exact same ...
-1
votes
1
answer
154
views
How to convert html to docx for a table with nested tables?
I want to convert any html with a table that has nested tables in its cells.
When I try to do this, additional rows appear after the rows in which the nested tables were located.
The number of rows ...
0
votes
0
answers
96
views
how can i extract numbered lists,bullets and alignment of content if docx file using python docx
I can extract the contents of a DOCX file using Python's python-docx, and I am generating an HTML file from the extracted content. However, I'm struggling to ensure that the contents are properly ...
3
votes
0
answers
66
views
How to Replace Placeholders in a DOCX File with Flutter without Server-Side Processing?
I am trying to programmatically replace placeholders in a DOCX file with specific text using Flutter, without relying on any server-side processing. I need to update the placeholder {name} with the ...
0
votes
0
answers
31
views
OpenXML body.Elements<Paragraph>() Empty When Extracting Paragraphs from DOCX in .NET 8
I'm working on a .NET 8 project where I need to read the contents of a DOCX file with exact formatting (spaces, line break and paragraph break) using the WordprocessingDocument class from the ...
0
votes
0
answers
42
views
How to remove Word content?
Can anyone tell me how to delete paragraphs and tables in Word? I looked for this in the python docx documentation, but it provides more information on adding content. I am attempting to address the ...