docx
docx copied to clipboard
Adding check boxes to the document, is it possible?
In the documentation I could not find anything about the checkboxes. Is it a part of the library, is it planned? Or is it something that can be added by someone else?
Thanks!
Checkbox characters, or an interactive check-able checkbox?
@jamesmontalvo3 Interactive check-able checkboxes. Specifically w:checkBox.
I have done the required research into how to add this to the library. However I have a question;
The definition of the checkbox is not just one element. This requires me to create a Run with a Bookmark that has 2 runs inside as 3 same level elements. As such, I can't contain it as just one Run. What would be the preferable way to approach this for the library?
This also requires me to update the BookmarkStart and give it the ability to have something inside there. Is this alright?
I can already see the checkboxes within the document although with quite a nasty code.
@dolanmiu
@htkibar 具体怎么使用?
@dolanmiu If you have time, could you please help me about the questions? I might be able to send this feature as a PR.
@chf12345678 你什么意思?
The definition of the checkbox is not just one element. This requires me to create a Run with a Bookmark that has 2 runs inside as 3 same level elements. As such, I can't contain it as just one Run. What would be the preferable way to approach this for the library?
Create a run of a certain type. This library has TextRun and PictureRun already, I see why not a CheckboxRun could be implemented
This also requires me to update the BookmarkStart and give it the ability to have something inside there. Is this alright?
Ok sure, add it in, then I will review, and alter it if need be.
Was this ever added?
Is this added??
Not yet no
Hi @dolanmiu, are checkboxes something to be added in the near future or is it still not in the foreseeable future?
text ☑
It is possible yes, a PR has been raised and merged in with the feature:
https://github.com/dolanmiu/docx/pull/2189
Thanks!