docx icon indicating copy to clipboard operation
docx copied to clipboard

Adding check boxes to the document, is it possible?

Open tukantje opened this issue 6 years ago • 10 comments

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!

tukantje avatar Sep 06 '19 15:09 tukantje

Checkbox characters, or an interactive check-able checkbox?

jamesmontalvo3 avatar Sep 06 '19 16:09 jamesmontalvo3

@jamesmontalvo3 Interactive check-able checkboxes. Specifically w:checkBox.

tukantje avatar Sep 06 '19 17:09 tukantje

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

tukantje avatar Sep 06 '19 18:09 tukantje

@htkibar 具体怎么使用?

dundundundunyourou avatar Sep 11 '19 07:09 dundundundunyourou

@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 你什么意思?

tukantje avatar Sep 18 '19 13:09 tukantje

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.

dolanmiu avatar Nov 24 '19 04:11 dolanmiu

Was this ever added?

skylerp208 avatar Dec 18 '20 15:12 skylerp208

Is this added??

veeresh745-sys avatar Mar 31 '21 08:03 veeresh745-sys

Not yet no

dolanmiu avatar Mar 31 '21 14:03 dolanmiu

Hi @dolanmiu, are checkboxes something to be added in the near future or is it still not in the foreseeable future?

rzempo avatar Nov 10 '21 13:11 rzempo

text ☑

jiazez avatar Jan 10 '23 03:01 jiazez

It is possible yes, a PR has been raised and merged in with the feature:

https://github.com/dolanmiu/docx/pull/2189

Thanks!

dolanmiu avatar Jun 25 '23 02:06 dolanmiu