We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Rotation point

Hi!
My code example:

Shape shape = new Shape(_processingDocument, ShapeType.ARROW);
shape.setStrokeColor(Color.RED);

shape.setRotation(radians * 180 / Math.PI);

shape.setLeft(left - leftMargin);
shape.setTop(top - topMargin);
shape.setWidth(width);
shape.setHeight(height);

Paragraph firstPageParagraph = getPageNode(1 /* page number */);
firstPageParagraph.appendChild(shape);

How I can change center point for rotate shape around custom x, y ?

Hi there,

Thanks for your inquiry. Could you please attach a sample Word document which contains a shape that demonstrates what type of rotation you are after?

Thanks,

Hi!
This is screenshot about how it looks after rotation now - http://screencast.com/t/2ZnpVVPgK
This is screenshot about how I want - http://screencast.com/t/KYiusUtyTJQ
This is screenshot with shape before rotation - http://screencast.com/t/CUGFXVsRr8
File I also attached (with current behavior)
Thank you.

Hi there,

Thanks
for sharing the detail. Please note that Aspose.Words mimics the same behavior as MS Word does. In your case, I suggest you please insert the shape type DOWN_ARROW in your document and rotate it according to your requirement. The down arrow shape has same center of rotation as you mentioned in screenshot. Please check the following code example for your kind reference.

Hope this helps you. Please let us know if you have any more queries.

Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);
builder.getFont().setSize(24);
builder.getParagraphFormat().setSpaceAfter(25);
builder.writeln("About GroupDocs");
Paragraph para = (Paragraph)builder.getCurrentParagraph().getPreviousSibling();
Shape shape = new Shape(doc, ShapeType.DOWN_ARROW);
shape.setStrokeColor(Color.RED);
shape.setWrapType(WrapType.NONE);
shape.setWidth(10);
shape.setHeight(40);
shape.setRotation(-45);
shape.setRelativeHorizontalPosition(RelativeHorizontalPosition.LEFT_MARGIN);
shape.setLeft(builder.getPageSetup().getLeftMargin() + Math.round(shape.getHeight()/2));
shape.setRelativeVerticalPosition(RelativeVerticalPosition.PARAGRAPH);
shape.setTop(20);
para.appendChild(shape);
builder.writeln("The Problem and Our Solution");
doc.save(MyDir + "Out.docx");
doc.save(MyDir + "Out.pdf");