Ink
Contents
[
Hide
]
This article provides examples of accessing existing ink shapes and removing them using Aspose.Slides for Node.js via Java.
❗ Note: Ink shapes represent user input from specialized devices. Aspose.Slides cannot create new ink strokes programmatically, but you can read and modify existing ink.
Access Ink
Retrieve the first ink shape on a slide.
function accessInk() {
let presentation = new aspose.slides.Presentation("ink.pptx");
try {
let slide = presentation.getSlides().get_Item(0);
let inkShape = null;
for (let i = 0; i < slide.getShapes().size(); i++) {
let shape = slide.getShapes().get_Item(i);
if (java.instanceOf(shape, "com.aspose.slides.IInk")) {
inkShape = shape;
break;
}
}
} finally {
presentation.dispose();
}
}
Remove Ink
Delete an ink shape from the slide.
function removeInk() {
let presentation = new aspose.slides.Presentation("ink.pptx");
try {
let slide = presentation.getSlides().get_Item(0);
// Assuming the ink shape is the first shape on the slide.
slide.getShapes().removeAt(0);
presentation.save("ink_removed.pptx", aspose.slides.SaveFormat.Pptx);
} finally {
presentation.dispose();
}
}