WortArt Wasserzeichen zum Diagramm mit Node.js über C++ hinzufügen
Contents
[
Hide
]
Sie können WordArt verwenden, um spezielle Texteffekte für Tabellenkalkulationen hinzuzufügen. Zum Beispiel einen Titel strecken, Text dekorieren, den Text in eine voreingestellte Form passen lassen oder den betroffenen Text auf den Diagrammbereich eines Diagramms als Wasserzeichen anwenden. Das WordArt wird zu einem Objekt, das Sie in Ihren Tabellenkalkulationen bewegen oder positionieren können, um Dekorationen hinzuzufügen.
Das folgende Beispiel zeigt, wie Sie eine WordArt-Form als Wasserzeichen für den Diagrammbereich hinzufügen.
Das folgende Beispiel zeigt, wie Sie eine WordArt-Form als Wasserzeichen für den Plotbereich eines vorhandenen Diagramms hinzufügen.
const path = require("path");
const AsposeCells = require("aspose.cells.node");
// The path to the documents directory.
const dataDir = path.join(__dirname, "data");
const filePath = path.join(dataDir, "sample.xlsx");
// Open the existing excel file.
const workbook = new AsposeCells.Workbook(filePath);
// Get the chart in the first worksheet.
const chart = workbook.getWorksheets().get(0).getCharts().get(0);
// Add a WordArt watermark (shape) to the chart's plot area.
const wordart = chart.getShapes().addTextEffectInChart(AsposeCells.MsoPresetTextEffect.TextEffect2,
"CONFIDENTIAL", "Arial Black", 66, false, false, 1200, 500, 2000, 3000);
// Get the shape's fill format.
const wordArtFormat = wordart.getFill();
// Set the transparency.
wordArtFormat.setTransparency(0.9);
// Get the line format.
const lineFormat = wordart.getLine();
// Set Line format to invisible.
lineFormat.setWeight(0.0);
// Save the excel file.
workbook.save(path.join(dataDir, "output_out.xlsx"));