Чернила
Contents
[
Hide
]
Provides examples of accessing existing ink shapes and removing them using Aspose.Slides for PHP 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
Get the first ink shape on a slide.
function accessInk() {
$presentation = new Presentation("ink.pptx");
try {
$slide = $presentation->getSlides()->get_Item(0);
// Доступ к первой фигуре чернил на слайде.
$firstInk = null;
$shapeCount = java_values($slide->getShapes()->size());
for ($index = 0; $index < $shapeCount; $index++) {
$shape = $slide->getShapes()->get_Item($index);
if (java_instanceof($shape, new JavaClass("com.aspose.slides.Ink"))) {
$firstInk = $shape;
break;
}
}
} finally {
$presentation->dispose();
}
}
Remove Ink
Delete an ink shape from the slide.
function removeInk() {
$presentation = new Presentation("ink.pptx");
try {
$slide = $presentation->getSlides()->get_Item(0);
// Предполагая, что первая фигура на слайде является фигурой чернил.
$ink = $slide->getShapes()->get_Item(0);
$slide->getShapes()->remove($ink);
$presentation->save("ink_removed.pptx", SaveFormat::Pptx);
} finally {
$presentation->dispose();
}
}