Get Started
Documentation

Copy

Copy() → { ApiParagraph }

Create a copy of the paragraph. Ingonore comments, footnote references, complex fields

Returns:

Type
ApiParagraph

Example

Copy code
builder.CreateFile("pptx");
oPresentation = Api.GetPresentation();
oSlide = oPresentation.GetSlideByIndex(0);
oSlide.RemoveAllObjects();
oFill = Api.CreateSolidFill(Api.CreateRGBColor(61, 74, 107));
oStroke = Api.CreateStroke(0, Api.CreateNoFill());
oShape = Api.CreateShape("flowChartMagneticTape", 300 * 36000, 130 * 36000, oFill, oStroke);
oShape.SetPosition(608400, 1267200);
oDocContent = oShape.GetDocContent();
oDocContent.RemoveAllElements();
oParagraph = Api.CreateParagraph();
oParagraph.SetJc("left");
oParagraph.AddText("This is just a sample text that was copied.");
oDocContent.Push(oParagraph);
oCopyParagraph = oParagraph.Copy();
oDocContent.Push(oCopyParagraph);
oSlide.AddObject(oShape);
builder.SaveFile("pptx", "Copy.pptx");
builder.CloseFile();

Resulting document