Ajouter un filigrane Word Art au graphique

Aspose.Cells - Ajouter un filigrane Word Art au graphique

Vous pouvez utiliser WordArt pour ajouter des effets de texte spéciaux aux feuilles de calcul. Par exemple, étirez un titre, décorez du texte, adaptez le texte à une forme prédéfinie ou appliquez le texte affecté à la zone de traçage d’un graphique en tant que filigrane. Le WordArt devient un objet que vous pouvez déplacer ou positionner dans vos feuilles de calcul pour ajouter de la décoration.

Java

 //Instantiate a new workbook.

//Open the existing excel file.

Workbook workbook = new Workbook(dataDir + "AsposeChart.xls");

//Get the chart in the first worksheet.

com.aspose.cells.Chart chart = workbook.getWorksheets().get(0).getCharts().get(0);

//Add a WordArt watermark (shape) to the chart's plot area.

com.aspose.cells.Shape wordart = chart.getShapes().addTextEffectInChart(MsoPresetTextEffect.TEXT_EFFECT_2,

"CONFIDENTIAL", "Arial Black", 66, false, false, 1200, 500, 2000, 3000);

//Get the shape's fill format.

FillFormat wordArtFormat = wordart.getFill();

//Set the transparency.

wordArtFormat.setTransparency(0.9);

//Make the line invisible.

wordart.setHasLine(false);

//Save the excel file.

workbook.save(dataDir + "AsposeChartWatermarked_Out.xls", SaveFormat.EXCEL_97_TO_2003);

Télécharger le code d’exécution

Télécharger l’exemple de code