Werk met Group Shapes in Word-Dokumente

Contents
[ ]

Soms moet jy’n group shape by’n Word-dokument voeg. So’n group shape bestaan uit verskeie vorms.

In Microsoft Word kan jy vinnig’n group shape byvoeg deur die Groepopdrag/knoppie te gebruik. Individuele vorms in’n groep kan afsonderlik verskuif word.

In Aspose.Words is dit baie maklik om’n group shape te voeg met behulp van GroupShape klas. Shape word afsonderlik geskep met behulp van Shape klas en dan bygevoeg in GroupShape voorwerp met behulp van AppendChild metode.

Hieronder is’n paar van die Shape tipes ondersteun in Aspose.Words. Vir volledige lys, besoek asseblief ShapeType:

  • Reghoek
  • RoundRectangle
  • RoundRectangle
  • Ellipse
  • Diamant
  • Driehoek
  • RightTriangle
  • Parallelogram
  • Trapezium
  • Seshoek
  • Oktagon

Voorbeeld

Add a group shape into a Word document.

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");
	}
}