Skip to content
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

Allow setting number of columns for paragraph #664

Open
nikitavbv opened this issue Nov 26, 2023 · 3 comments
Open

Allow setting number of columns for paragraph #664

nikitavbv opened this issue Nov 26, 2023 · 3 comments

Comments

@nikitavbv
Copy link

First of all, thank you for maintaining this crate! It is really useful!

Is your feature request related to a problem? Please describe.

I am trying to create a document that contains both paragraphs with one and two columns. See the screenshot below for an example.

Screenshot 2023-11-26 at 1 54 38 PM

In my understanding, that can be achieved by setting section property for paragraph property. The problem is that while docx-rs supports setting section property, it is not included in the resulting XML.

Describe the solution you'd like

Include section property in the resulting XML of paragraph property.

Describe alternatives you've considered

It does not seem that there are any alternative solutions here. If I missed something, please let me know!

Additional context

Please let me know what you think about possible solutions, and I will be happy to submit an MR for this!

Thank you!

@nikitavbv
Copy link
Author

There is also Section, but it seems there is no way available to add it to the document and to access the property to update SectionProperty values.

@bokuweb
Copy link
Owner

bokuweb commented Dec 1, 2023

@nikitavbv Thanks. I'll consider about it. If it is possible, cloud you please provide sample docx?

@nikitavbv
Copy link
Author

@bokuweb Sure! Please see the attached file (I created it using Word).
example.docx

If you check how the resulting XML looks like, you may notice that Word adds empty paragraphs with a section property that
indicates how many columns are used in the preceding text:
document structure

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants