Работа с Group Форма в текстови документи

Contents
[ ]

Понякога трябва да добавите group shape в документ на Word. - group shape се състои от множество форми.

В Microsoft Word, Можете бързо да добавите group shape с помощта на Group команда/бутон. Индивидуална форма в група може да бъде преместена отделно.

В Aspose.Words е много лесно да се добави group shape приложение GroupShape Клас. Форма се създава отделно с помощта на Shape клас и след това добавен в GroupShape Използване на обект append_child метод.

Следният пример с код показва как да добавите a group shape в документ на Word:

# For complete examples and data files, please go to https://github.com/aspose-words/Aspose.Words-for-Python-via-.NET
doc = aw.Document()
doc.ensure_minimum()
groupShape = aw.drawing.GroupShape(doc)
accentBorderShape = aw.drawing.Shape(doc, aw.drawing.ShapeType.ACCENT_BORDER_CALLOUT1)
accentBorderShape.width = 100
accentBorderShape.height = 100
groupShape.append_child(accentBorderShape)
actionButtonShape = aw.drawing.Shape(doc, aw.drawing.ShapeType.ACTION_BUTTON_BEGINNING)
actionButtonShape.left = 100
actionButtonShape.width = 100
actionButtonShape.height = 200
groupShape.append_child(actionButtonShape)
groupShape.width = 200
groupShape.height = 200
groupShape.coord_size = drawing.Size(200, 200)
builder = aw.DocumentBuilder(doc)
builder.insert_node(groupShape)
doc.save(docs_base.artifacts_dir + "WorkingWithShapes.add_group_shape.docx")