Convert PPT to JPG online. Learn how to develop PowerPoint to JPG Converter using Node.js SDK
PowerPoint presentations are useful for data and information sharing, corporate briefings, lectures in universities, etc. But in order to view the presentation files, you need to have a specific application which may include installation and licensing costs. However, the raster image formats such as JPEG, PNG, GIF, BMP, etc can be viewed on any platform including Desktop or mobile devices. In this article, we are going to learn the steps on how to convert PowerPoint to JPG in the Node.js application.
- PowerPoint Conversion API
- Node.js SDK
- PowerPoint to JPG Conversion in Node.js
- Convert PPT to JPG using cURL Command
Info: Using its powerful Aspose.Slides API, Aspose developed a free PowerPoint to JPG Converter that allows you to convert slides in presentations to JPG images. You may also be interested in an app like Aspose JPG to PowerPoint Converter (based on a reversal of the process here) because this one allows you to create PowerPoint presentations from images.
PowerPoint Conversion API
Aspose.Slides Cloud is a REST-based API offering the capabilities to read, edit and convert PowerPoint presentations in the cloud. Extract the contents like text and images or render the PPT files to TIFF, PDF, XPS, HTML, etc, or other Supported Document Formats. No MS Office automation or any other application is required. Perform all the PPT processing in the Cloud on any platform of your choice i.e. Desktop, Web, or Mobile App. This API also supports the feature to set PowerPoint background images, work with PowerPoint images, manipulate presentation clipart, or even extract images in presentations.
Node.js SDK
We have created a wrapper around Aspose.Slides Cloud API named Aspose.Slides Cloud SDK for Node.js which provides all the capabilities of PowerPoint creation, manipulation, and conversion within Node.js application. No additional software download is required. The Cloud SDK is so amazing that you can process major Microsoft PowerPoint as well as OpenOffice file formats.
Installation
In order to get started, the first step is to install the download and install the Cloud SDK on the local system. Albeit it is available for download at NPM and GitHub. However, we are going to use the following command to install it from NPM.
npm i asposeslidescloud
In order to ensure data protection and integrity, only authorized persons can access the Cloud services. So the next step is to create a Free account subscription on Aspose.Cloud dashboard. If you have GitHub or Google account, simply Sign Up. Otherwise, click on the Create a new Account button and provide the required information. Now login to the dashboard using credentials and expand the Applications section from the dashboard and scroll down towards the Client Credentials section to see Client ID and Client Secret details.
PowerPoint to JPG Conversion in Node.js
Please follow the instructions given below for PowerPoint to JPG conversion using Node.js.
- First, we need to add the references of classes from asposeslidescloud package
- Create two const instances holding Client ID and Client Secret details
- Now we need to create an object of SlidesApi class while passing ClientID and Client Secret details as arguments
- The next step is to create an object of PostSlidesConvertRequest class where we set the output format and input PPT file content
- Now call the postSlidesConvert()… method of SlidesApi class and pass PostSlidesConvertRequest object as an argument
- Print conversion response in console
Convert PPT to JPG using cURL Command
We also get the leverage to access REST API using the cURL commands over the command line terminal. But, as our APIs are only accessible to authorized users only, so we need to first generate a JWT access token based on Client ID and Client Secret details as specified on Aspose.Cloud dashboard. Please execute the following command to generate the JWT access token.
curl -v "https://api.aspose.cloud/connect/token" \
-X POST \
-d "grant_type=client_credentials&client_id=718e4235-8866-4ebe-bff4-f5a14a4b6466&client_secret=388e864b819d8b067a8b1cb625a2ea8e" \
-H "Content-Type: application/x-www-form-urlencoded" \
-H "Accept: application/json"
The next step is to convert the PPT file already available on cloud storage to JPG using the following cURL command. Please note that we are only converting the slide at index 2 to JPEG format. The Width value is specified as 600, the Height value is specified as 800 and the name of the resultant file is MyConverted.jpeg.
curl -X PUT "https://api.aspose.cloud/v3.0/slides/Animated%20PowerPoint.ppt/slides/2/Jpeg?outPath=MyConverted.jpeg&width=600&height=800" \
-H "accept: application/json" \
-H "authorization: Bearer <JWT Token>" \
-H "Content-Type: application/json" \
-d "{ \"Format\": \"Jpeg\"}"
Request URL
https://api.aspose.cloud/v3.0/slides/Animated%20PowerPoint%20template.pptx/slides/3/Jpeg?outPath=MyConverted.jpeg&width=600&height=800
The sample files used in the above example can be downloaded from the following links
Conclusion
We have explored the capabilities of Aspose.Slides Cloud SDK for Node.js to convert a PowerPoint to JPG image. As you have noticed, the conversion is so simple that few code lines can do all the processing without losing any content or compromising the output quality. Furthermore, we have also seen the steps on how to perform PPTX to JPG conversion using the cURL commands in the command line terminal. Since all our Cloud SDKs are developed under an MIT license, so you may download the complete source code of SDK available on GitHub.
Please try using the API and in case you encounter any issues, please feel free to contact us via the Free Product support forum.
TIP: Want to see the API in action ? Try using our FREE online PowerPoint to JPG converter App.
Related Articles
We also suggest you explore the following articles and learn about: