Convert PPT to JPG in PHP

This article will teach you how to convert PPT to JPG in PHP. First, we will provide a PHP API (Aspose.Slides for PHP via Java) that makes the conversion process easy. Second, we will walk you through two PowerPoint to JPG image conversion tasks.

Microsoft PowerPoint Presentation format PPT, PPTX files are hardly the easiest objects to open and display on web pages and applications. JPGs, on the other hand, can be accessed, opened, and used everywhere. Therefore, getting the slides in a presentation to appear as images is a useful operation.

Get PowerPoint PHP API

Aspose.Slides for PHP via Java is a feature-rich presentation API that allows you to read and manipulate PowerPoint and other presentations in PHP applications or environments.

Aspose.Slides for PHP via Java

Using this PHP API, you can transform PowerPoint slides to JPG images by running a few code lines.

To learn how to install Aspose.Slides for PHP via Java, go to the Installation page in our documentation.

TIP: You may want to check out Aspose’s free JPG to PowerPoint web app because it is a live implementation of the conversion process.

Convert PPT to JPG in PHP

  1. Instantiate a Presentation object to load the PowerPoint presentation you want to convert to JPG images.
  2. Iterate through each slide using the ISlide interface.
  3. Create a fullscale image object based on each slide’s thumbnail with each iteration.
  4. Save the objects as JPG images.

This PHP code shows you how to convert PowerPoint to JPG in PHP:

Convert PPT to Customized JPG Images in PHP

  1. Instantiate a Presentation object to load the PowerPoint presentation you want to convert to JPG images.
  2. Set your preferred dimensions by specifying the scaling values for the x-axis and y-axis using the slide’s width and height, respectively.
  3. Iterate through each slide using the ISlide interface.
  4. Create a fullscale image object based on each slide’s thumbnail with each iteration.
  5. Save the objects as JPG images.

This PHP code shows you how to convert PowerPoint to JPG images with customized dimensions in PHP:

Conclusion

We walked you through two operations on converting PPT to JPG in PHP. You may want to check out the feature-rich PHP API that powers the process.

Using Aspose.Slides for PHP via Java, you can do a lot more than convert PPT to JPG—you can open and edit PowerPoint documents and presentations in other formats, convert PPT to PNG, convert PPT to PDF, convert PDF to PPT, and perform many other conversions and manipulations. See the product features page to learn more.