العمل مع شكل Group في مستندات Word

Contents
[ ]

في بعض الأحيان تحتاج إلى إضافة group shape إلى مستند Word. يتكون group shape هذا من أشكال متعددة.

في Microsoft Word، يمكنك إضافة group shape بسرعة باستخدام أمر/زر Group. يمكن نقل شكل فردي في مجموعة بشكل منفصل.

في Aspose.Words، من السهل جدًا إضافة group shape باستخدام فئة GroupShape. يتم إنشاء الشكل بشكل منفصل باستخدام فئة Shape ثم تتم إضافته إلى كائن GroupShape باستخدام طريقة append_child.

يوضح مثال التعليمات البرمجية التالي كيفية إضافة 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")