Git Product home page Git Product logo

Comments (4)

scanny avatar scanny commented on June 25, 2024

Hi Charl, what I would do would be to see what Word does when you set it the way you want and try to duplicate that.

One way to do that is to use opc-diag to browse a before and after version of the .docx file. The command would be something like this:

$ opc diff-item before.docx after.docx document.xml

I expect the difference comes down to a few elements and/or attributes in the table properties XML.

If you can narrow it down to those specifics I can give you a couple lines of code to put that XML in place. You can wrap that in a function or method and call it in the right spot in your code.

Once we have it working we can noodle a bit what the API for doing it directly from the library wants to look like and then we can add it to the backlog.

Want to give that a shot?

from python-docx.

cpbotha avatar cpbotha commented on June 25, 2024

Thanks for responding so quickly!

I'd like to try that. However, here I have only LibreOffice 4.1.4.2 to test the DOCX, and that generates a whole lot of extra code in the resultant file. Tomorrow at work I hope to be able to test with a real-deal Word and look at the differences.

from python-docx.

cpbotha avatar cpbotha commented on June 25, 2024

A kind colleague just checked with MS Word and there it renders correctly.

Sorry for the disturbance. Hopefully this closed issue report will help other LibreOffice users in the future. :)

Thanks again,
Charl

from python-docx.

scanny avatar scanny commented on June 25, 2024

No worries, thanks Charl :)

from python-docx.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.