presetTexture property

Fill.presetTexture property

Gets a PresetTexture for the fill.

get presetTexture(): Aspose.Words.Drawing.PresetTexture

Examples

Shows how to fill and tiling the texture inside the shape.

let doc = new aw.Document();
let builder = new aw.DocumentBuilder(doc);

let shape = builder.insertShape(aw.Drawing.ShapeType.Rectangle, 80, 80);

// Apply texture alignment to the shape fill.
shape.fill.presetTextured(aw.Drawing.PresetTexture.Canvas);
shape.fill.textureAlignment = aw.Drawing.TextureAlignment.TopRight;

// Use the compliance option to define the shape using DML if you want to get "TextureAlignment"
// property after the document saves.
let saveOptions = new aw.Saving.OoxmlSaveOptions();
saveOptions.compliance = aw.Saving.OoxmlCompliance.Iso29500_2008_Strict;

doc.save(base.artifactsDir + "Shape.TextureFill.docx", saveOptions);

doc = new aw.Document(base.artifactsDir + "Shape.TextureFill.docx");

shape = doc.getShape(0, true);

expect(shape.fill.textureAlignment).toEqual(aw.Drawing.TextureAlignment.TopRight);
expect(shape.fill.presetTexture).toEqual(aw.Drawing.PresetTexture.Canvas);

See Also