Export Presentations in Handout Layouts
Seamlessly export presentations in various handout layouts using version 23.12 of Aspose.Slides for PHP via Java. This update enables mimicking PowerPoint’s “Print as Handouts” feature in your apps. The following code sample shows how to render PowerPoint presentations as handouts:
$pres = new Presentation("pres.pptx");
try {
$options = new RenderingOptions();
$handoutLayoutingOptions = new HandoutLayoutingOptions();
$handoutLayoutingOptions->setHandout(HandoutType::Handouts4Horizontal);
$handoutLayoutingOptions->setPrintSlideNumbers(false);
$options->setSlidesLayoutOptions($handoutLayoutingOptions);
$size = new Java("java.awt.Dimension", 1024, 1080);
$bmp = $pres->getThumbnails($options, $size)[0];
$imageio = new Java("javax.imageio.ImageIO");
$javafile = new Java("java.io.File", "pres-handout.png");
$imageio->write($bmp, "PNG", $javafile);
} finally {
if ($pres != null) $pres->dispose();
}
Source*
Control Ink Object Appearance
PHP developers can utilize the InkOptions
class to manage the visibility and rendering of the “Ink” elements in exported presentations. Please refer to the code example shared below to learn about using this class:
$pres = new Presentation("InkOptions.pptx");
try {
$options = new PdfOptions();
$options->getInkOptions()->setHideInk(true);
$pres->save("pres.pdf", SaveFormat::Pdf, $options);
} finally {
if ($pres != null) $pres->dispose();
}
Source*
Reduced File Size
We have introduced the IPictureFillFormat.DeletePictureCroppedAreas
method that helps minimize presentation file size by removing the cropped areas from a photo. The following coding sample highlights method usage:
$presentation = new Presentation("demo.pptx");
try {
$slide = $presentation->getSlides()->get_Item(0);
// Gets the PictureFrame
$picFrame = $slide->getShapes()->get_Item(0);
// Deletes cropped areas of the PictureFrame image
$croppedImage = $picFrame->getPictureFormat()->deletePictureCroppedAreas();
$presentation->save("output.pptx", SaveFormat::Pptx);
} finally {
if ($presentation != null) $presentation->dispose();
}
Source*
Shape Enhancements
The Shape.IsDecorative
property added to version 23.12 of the PHP API allows you to designate shapes for decorative purposes. You can learn about how to use this property by reviewing the following code:
$pres = new Presentation("sample.pptx");
try {
$pres->getSlides()->get_Item(0)->getShapes()->get_Item(0)->setDecorative(true);
} finally {
if ($pres != null) $pres->dispose();
}
Source*
You can view the list of all new features, enhancements, and bug fixes introduced in this release by visiting Aspose.Slides for PHP via Java 23.12 Release Notes.