com.aspose.words
Class SoftEdgeFormat

java.lang.Object
    extended by com.aspose.words.SoftEdgeFormat

public class SoftEdgeFormat 
extends java.lang.Object

Represents the soft edge formatting for an object.

Use the ShapeBase.SoftEdge property to access soft edge properties of an object. You do not create instances of the SoftEdgeFormat class directly.

Example:

Shows how to work with soft edge formatting.
DocumentBuilder builder = new DocumentBuilder();
Shape shape = builder.insertShape(ShapeType.RECTANGLE, 200.0, 200.0);

// Apply soft edge to the shape.
shape.getSoftEdge().setRadius(30.0);

builder.getDocument().save(getArtifactsDir() + "Shape.SoftEdge.docx");

// Load document with rectangle shape with soft edge.
Document doc = new Document(getArtifactsDir() + "Shape.SoftEdge.docx");
shape = (Shape)doc.getChild(NodeType.SHAPE, 0, true);

// Check soft edge radius.
Assert.assertEquals(30, shape.getSoftEdge().getRadius());

// Remove soft edge from the shape.
shape.getSoftEdge().remove();

// Check radius of the removed soft edge.
Assert.assertEquals(0, shape.getSoftEdge().getRadius());

Property Getters/Setters Summary
doublegetRadius()
voidsetRadius(double value)
           Gets or sets a double value that represents the length of the radius for a soft edge effect in points (pt). The default value is 0.0.
 
Method Summary
voidremove()
           Removes SoftEdgeFormat from the parent object.
 

Property Getters/Setters Detail

getRadius/setRadius

public double getRadius() / public void setRadius(double value)
Gets or sets a double value that represents the length of the radius for a soft edge effect in points (pt). The default value is 0.0.

Example:

Shows how to set limit for image resolution.
Document doc = new Document(getMyDir() + "Rendering.docx");

SvgSaveOptions saveOptions = new SvgSaveOptions();
saveOptions.setMaxImageResolution(72);

doc.save(getArtifactsDir() + "SvgSaveOptions.MaxImageResolution.svg", saveOptions);

Example:

Shows how to work with soft edge formatting.
DocumentBuilder builder = new DocumentBuilder();
Shape shape = builder.insertShape(ShapeType.RECTANGLE, 200.0, 200.0);

// Apply soft edge to the shape.
shape.getSoftEdge().setRadius(30.0);

builder.getDocument().save(getArtifactsDir() + "Shape.SoftEdge.docx");

// Load document with rectangle shape with soft edge.
Document doc = new Document(getArtifactsDir() + "Shape.SoftEdge.docx");
shape = (Shape)doc.getChild(NodeType.SHAPE, 0, true);

// Check soft edge radius.
Assert.assertEquals(30, shape.getSoftEdge().getRadius());

// Remove soft edge from the shape.
shape.getSoftEdge().remove();

// Check radius of the removed soft edge.
Assert.assertEquals(0, shape.getSoftEdge().getRadius());

Method Detail

remove

public void remove()
Removes SoftEdgeFormat from the parent object.

Example:

Shows how to work with soft edge formatting.
DocumentBuilder builder = new DocumentBuilder();
Shape shape = builder.insertShape(ShapeType.RECTANGLE, 200.0, 200.0);

// Apply soft edge to the shape.
shape.getSoftEdge().setRadius(30.0);

builder.getDocument().save(getArtifactsDir() + "Shape.SoftEdge.docx");

// Load document with rectangle shape with soft edge.
Document doc = new Document(getArtifactsDir() + "Shape.SoftEdge.docx");
shape = (Shape)doc.getChild(NodeType.SHAPE, 0, true);

// Check soft edge radius.
Assert.assertEquals(30, shape.getSoftEdge().getRadius());

// Remove soft edge from the shape.
shape.getSoftEdge().remove();

// Check radius of the removed soft edge.
Assert.assertEquals(0, shape.getSoftEdge().getRadius());

Example:

Shows how to set limit for image resolution.
Document doc = new Document(getMyDir() + "Rendering.docx");

SvgSaveOptions saveOptions = new SvgSaveOptions();
saveOptions.setMaxImageResolution(72);

doc.save(getArtifactsDir() + "SvgSaveOptions.MaxImageResolution.svg", saveOptions);

See Also:
          Aspose.Words Documentation - the home page for the Aspose.Words Product Documentation.
          Aspose.Words Support Forum - our preferred method of support.