Arbeiten mit Group Formen in Word-Dokumenten

Contents
[ ]

Manchmal muss man ein group shape in ein Word-Dokument. Eine solche group shape besteht aus mehreren Formen

In Microsoft Word, Sie können schnell hinzufügen group shape Verwendung von Group Befehl/Taste. Einzelne Formen in einer Gruppe können separat bewegt werden.

In Aspose.Words es ist sehr einfach, ein group shape Verwendung GroupShape Klasse. Shape wird separat mit Shape Klasse und dann in GroupShape Objekt verwenden AppendChild Methode.

Unten sind einige der Shape unterstützte Typen Aspose.Words. Für vollständige Liste, bitte besuchen ShapeType:

  • Rechteck
  • RoundRectangle
  • RoundRectangle
  • Ellipse
  • Diamant
  • Dreieck
  • Das rechte Dreieck
  • Parallelogramm
  • Trapezoid
  • Hexagon
  • Oktagon

Example

*Einfügen eines group shape in ein Word-Dokument. *

package AddGroupShape;
import Aspose.Words.*;
import Aspose.Words.Drawing.*;
import Aspose.Words.Fields.*;
public class Program
{
	public static void main(String[] args)
	{
		Aspose.Words.Document doc = new Aspose.Words.Document();
	        doc.EnsureMinimum();
		GroupShape gs = new GroupShape(doc);
		Aspose.Words.Drawing.Shape shape = new Aspose.Words.Drawing.Shape(doc, Aspose.Words.Drawing.ShapeType.AccentBorderCallout1);
		shape.Width = 100;
		shape.Height = 100;
		gs.AppendChild(shape);
		Aspose.Words.Drawing.Shape shape1 = new Aspose.Words.Drawing.Shape(doc, Aspose.Words.Drawing.ShapeType.ActionButtonBeginning);
		shape1.Left = 100;
		shape1.Width = 100;
		shape1.Height = 200;
		gs.AppendChild(shape1);
	        gs.Width = 200;
		gs.Height = 200;
		gs.CoordSize = new System.Drawing.Size(200, 200);
		DocumentBuilder builder = new DocumentBuilder(doc);
		builder.InsertNode(gs);
		doc.Save("c:\\TestFile.docx");
	}
}