48 questions
0
votes
0
answers
36
views
How to perform multiple "render()" calls with docxtpl without losing unresolved variables?
I’m trying to fill a .docx template using the docxtpl library in Python, but I need to do it in multiple steps, because I can’t load the entire context dictionary into memory at once.
The problem is ...
2
votes
1
answer
214
views
How to dynamically merge cells horizontally using docxtpl?
I am trying to automatically merge columns of tables using docxtpl on python.
My tables are in the following form:
context = {
'tbl_contents': [
{'label': '1', 'cols': ['A','A','B']},
{'label':...
0
votes
1
answer
341
views
Losing images in docx template while rendering
I am using docxtpl (python-docx-template) to render a template before I actually render the content from a dict. Although everything works, my images keep missing.
I collect multiple other docx-files ...
0
votes
2
answers
250
views
Pysimplegui : input data from table to docxtpl
I am building a little script to make faster word documents. With the help of docxtpl and pysimplegui
Now I want to create a table to fill in data.
My table layout looks like this:
headings = ['test1',...
2
votes
1
answer
460
views
How populate this complex table with python docx template?
Well, I continue to use the python-docx-template.
I was making the template for some tables, specifically this one:
The result table that I'm looking for is this (leaving aside the date/fecha):
The ...
0
votes
0
answers
564
views
docxtpl is replacing my "&" in my word template with blanks. It is also not adding in the & from my Python code
#My code is as follows:
from docxtpl import DocxTemplate
adjective = "results & data-driven"
doc = DocXTemplate("Resume_Template.docx")
context = {'job_title': adjective}
...
0
votes
0
answers
522
views
Error: Unexpected : "}" using docxtpl but can't seem to find where it is in my code. Am I reading the error wrong?
I'm using Python 3.11.2
The tags I have in my word document are as follows: {{first_name}} {{last name}}
My code is below creating tags to replace in a word document. I kept the tags and variables the ...
1
vote
0
answers
50
views
Doctxpl doesnt create a new save document
While the code runs without issues, I cannot locate the "perro.docx" document (the one with the replaceable variables). It's not in the same folder as my Python file and document template. ...
1
vote
0
answers
72
views
Switch PDF file according to value in DataFrame column using Python and DocxTemplate
I have an Excel file with a list of clients, including their name, document number, credit card number, and company. For each client, I need to create a PDF file with the values from the table. First, ...
0
votes
0
answers
552
views
RPC Server Unavailable: Printing Word Doc in Python
I am writing a Python program to print out a document. However, If I try to print something out a second time, I get an error stating 'RPC Server Unavailable"
Here is my code, using win32com and ...
-2
votes
1
answer
506
views
How can i create table using Docxptl in Python?
I want to create a table using docxtpl in python, where the table rows should be dynamic
For eg:
user_dict = [{"name": "Person 1", "age": 25, "job": "...
1
vote
1
answer
848
views
Using docxtpl library in Python, how to generate complex Word documents from multiple tables of different data?
Using docxtpl library in Python to generate complex Microsoft Word documents from Excel data, is it possible to generate a single document from multiple "contexts" or tables?
For example, ...
0
votes
2
answers
2k
views
python docxtpl insert two sub documents into one template
I would like to insert two generated sub documents into one template. It partly works, but it seems that there is a bug in docxtpl. The end of my template disappears if I insert my sub document(s).
...
0
votes
1
answer
2k
views
expected token ‘end of print statement’, got ‘Size’
I am trying to automate population of word template using python. The library I am using is docxtpl to help me do that. I am getting this expected token ‘end of print statement’ got ‘Size’ error and ...
0
votes
1
answer
393
views
Python printing & (and) character in MS word through python
I am generating MS word files through Python using docxtpl. I am trying to import the Humanities&Social Sciences text into an MS word file. But, I see Humanities Sciences printed in MS word.
I ...
0
votes
1
answer
7k
views
In Python, how to solve 'ModuleNotFoundError: No module named 'docxtpl'
I have installed pip install docxtpl with no errors. Previously I have ran programs with no erros. But I am getting this weird error of no module found. Don't know what to do?
Installation:
Nomodule ...
0
votes
1
answer
906
views
copy data table from csv file to word document in table using python and jinja2
Anyone can help me for my code, I am using existing Word Template to extract from csv file to write in table inside template word, and using python libraries such as: docxtpl, pandas, csv
user.dst ...
0
votes
1
answer
704
views
Problem generator docxtpl flask - not work save file
I have a problem with my code.
I'm trying to create a docx generator with docxtpl and flask, but I can't get it to work. My intention is to download the file generated with the information acquired ...
4
votes
1
answer
3k
views
docxtpl special tr tag {%tr %} is not working
Hi i am using docxtpl to generate the MS Word documents from python using JINJA template engine, I checked this documentation which says we can use special tags for table rows, columns and paragraphs ...
0
votes
0
answers
113
views
is there a way where i copy and paste a company address in python input and it prints as multiple line output?
I'm trying to copy & paste a company address into a python script to automate my cover letter. when I paste the address it shows up in a single line in the created word document. I want it to be ...
1
vote
1
answer
316
views
Docxtpl: Add heading level to text
How can I add a heading level to text with docxtpl?
Can I do something like this: ?
rt = RichText()
rt.add('Headername', level=1)
0
votes
1
answer
1k
views
¿How to generate a .docx document with python-docx-template (docxtpl)? Django Python
I am trying to generate a .docx document in Django for this I am using docxtpl (Python docx template) that generates documents through .docx templates. I try to generate the document with this data:
...
4
votes
2
answers
5k
views
Render simple HTML into docx using docxtpl
I'm using python module docxtpl to print data inside a docx template written with jinja2.
Works great so far but i need to render in the docx some simple HTML like this:
<h2>Some title</h2>...
0
votes
1
answer
2k
views
docxtpl: insert new row with borders
I have a word document page.docx containing tables and the python file file 1.py:
from docxtpl import DocxTemplate
doc = DocxTemplate("page.docx")
context = { 'text': 'there could be your ad'}
a = ...