Práce s Group Tvar ve slovních dokumentech

Contents
[ ]

Někdy musíte přidat group shape do dokumentu Word. Takový group shape sestává z více tvarů.

In Microsoft Word, můžete rychle přidat group shape s použitím Group příkaz/tlačítko. Jednotlivý tvar ve skupině lze pohybovat odděleně.

In Aspose.Words je velmi snadné přidat a group shape podání GroupShape třída. Tvar se vytváří samostatně pomocí Shape třída a poté přidána GroupShape objekt pomocí append_child metoda.

Následující příklad kódu ukazuje, jak přidat a group shape do dokumentu 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")