-
Notifications
You must be signed in to change notification settings - Fork 392
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SubDocs not rendering in LibreOffice/OpenOffice #537
Comments
Up The example given in the tests does not work for me. When I merge the docx I have just not visible content in the file. |
@elapouya sorry for the ping, I have seen you wrote the part of the code related to merging documents. I'm using python Thanks |
It requires good understanding of docx format to answer your question. Unfortunately I do not have sufficient knowledge about that, sorry
Le mar. 7 mai 2024 à 12:06, ScriptSathi ***@***.***(mailto:Le mar. 7 mai 2024 à 12:06, ScriptSathi <<a href=)> a écrit :
… ***@***.***(https://github.com/elapouya) sorry for the ping, I have seen you wrote the part of the code related to merging documents.
Do you have any hint to give us for this bug ?
I'm using python 3.12.3 and docxtpl version 0.17.0
Thanks
—
Reply to this email directly, [view it on GitHub](#537 (comment)), or [unsubscribe](https://github.com/notifications/unsubscribe-auth/AAGY33DTWI3UF6NRFZTIBW3ZBCRSXAVCNFSM6AAAAABGJDLMCGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAOJXHEZTCNBYHE).
You are receiving this because you were mentioned.Message ID: ***@***.***>
|
Running into this as well. It renders in Word, but interestingly when exporting from Sharepoint as a PDF it goes missing. Opening and printing to PDF retains it. |
OK so for me, I found that I can only see subdocuments when included with a This may be brittle but worked for me 🤷♂️: from docx.oxml.text.paragraph import CT_P
# Don't finish run without a paragraph, it corrupts the xml
elements = list(subdoc.element.body)
if len(elements) > 1 and not isinstance(elements[-2], CT_P):
subdoc.add_paragraph() |
Describe the bug
When creating subdocs with doc.new_subdoc() and opening the resulting docx file with LibreOffice, the subdoc is not visibile.
When opening the SAME .docx file with word, the subdoc content is correctly shown.
To Reproduce
Note: .docx files are attached.
test_libre_sub.docx
test_libre.docx
Open the file test_libre_rendered.docx with Word and with LibreOffice. Word renders the subdoc contents, LibreOffice does not.
Expected behavior
When opening the doc with either libreoffice the subdoc should be rendered.
Additional Info
Note that the subdoc itself ("./test_libre_sub_rendered.docx") correctly includes the rendered subdoc.
Tested on:
Mac (Intel) x64
OpenOffice: 4.1.15
LibreOffice: 24.2.2
The text was updated successfully, but these errors were encountered: