Convert PowerPoint to PDF using REST API in Node.js

Convert PowerPoint to PDF using REST API in Node.js

PowerPoint is commonly used to present information in a series of separate pages or slides for group presentations within business organizations. In certain cases, you may need to convert PowerPoint PPTX or PPT into PDF file programmatically. In this article, we will demonstrate how to convert PowerPoint to PDF using REST API in Node.js.

The following topics shall be covered in this article:

PowerPoint to PDF Conversion REST API and Node.js SDK

For converting PPTX to PDF file online, we will be using the Node.js SDK of GroupDocs.Conversion Cloud API. Please install it using the following command in the console:

npm install groupdocs-conversion-cloud

Please get your Client ID and Secret from the dashboard before following the mentioned steps. Once you have your ID and secret, add in the code as shown below:

How to Convert PowerPoint to PDF using Node.js REST API

We can convert PowerPoint presentation to PDF files by following the simple steps given below:

Upload the Document

Firstly, we will upload the PPTX file to the Cloud using the code example given below:

As a result, the uploaded pptx file will be available in the files section of the dashboard on the cloud.

Convert PowerPoint to PDF in Node.js

You can easily convert PPTX presentations to PDF documents programmatically by following the steps given below:

  • Firstly, create an instance of the ConvertApi.
  • Next, create an instance of the ConvertSettings.
  • Then, set the input pptx file path.
  • And, assign “pdf” to format.
  • Also, provide the output file path.
  • After that, create ConvertDocumentRequest with ConvertSettings as argument.
  • Finally, call the ConvertApi.convertDocument() method with ConvertDocumentRequest.

The following code example shows how to convert PPTX presentation to PDF document using REST API in Node.js:

Download PowerPoint Presentation

The above code sample will save the converted PDF file on the cloud. It can be downloaded using the following code example:

PowerPoint to PDF Conversion using Advanced Options

Now, in this section we will see how to convert PowerPoint presentation to PDF documents programmatically by following the steps given below:

  • Firstly, create an instance of the ConvertApi.
  • Now, create an instance of the ConvertSettings.
  • Then, set the input pptx file path.
  • And, assign “pdf” to format.
  • Also, provide the output file path.
  • Now, define the PdfConvertOptions and assign different convert options.
  • After that, create ConvertDocumentRequest with ConvertSettings as argument.
  • Finally, call the convertDocument() method with ConvertDocumentRequest.

The following code example shows how to convert PPTX to PDF using advanced options in node.js:

Please follow the steps mentioned earlier to upload and download files.

Convert Range of Pages from PPTX to PDF in Node.js

In this section, we can convert a range of pages from PPTX presentations to PDF documents programmatically by following the steps given below:

  • Firstly, create an instance of the ConvertApi.
  • Next, create an instance of the ConvertSettings.
  • Then, set the input PowerPoint file path.
  • And, assign “pdf” to format.
  • Also, provide the output file path.
  • Next, create an instance of the PdfConvertOptions.
  • Then, set a page range to convert from start page number as fromPage and total pages to convert as pagesCount.
  • After that, create ConvertDocumentRequest with ConvertSettings as argument.
  • Finally, call the ConvertApi.convertDocument() method with ConvertDocumentRequest.

The following code example shows how to convert a range of pages from PPTX to PDF using REST API in Node.js:

Convert Specific Pages of PPTX to PDF using Node.js

This section is about how to convert specific pages of PPTX presentations to PDF documents programmatically by following the steps given below:

  • Firstly, create an instance of the ConvertApi.
  • Next, create an instance of the ConvertSettings.
  • Then, set the input PPTX file path.
  • And, assign “pdf” to format.
  • Also, provide the output file path.
  • Next, create an instance of the PdfConvertOptions.
  • Then, provide specific page numbers in a comma-separated array to convert.
  • After that, create ConvertDocumentRequest with ConvertSettings as argument.
  • Finally, call the ConvertApi.convertDocument() method with ConvertDocumentRequest.

The following code example shows how to convert specific pages from PPTX to PDF using a REST API in Node.js:

PPT to PDF Converter Free Online

What is online PPT to PDF converter free? Please try the following free online PPT conversion tool, which is developed using the above API.

Conclusion

In this article, we have learned:

  • how to convert PowerPoint presentation to PDF file on the cloud;
  • how to convert specific pages or a range of pages from PPTX to PDF using Node.js;
  • programmatically upload PowerPoint file to the cloud;
  • download the converted PDF file from the Cloud;
  • convert PowerPoint to pdf online free;

Besides, you can learn more about GroupDocs.Conversion Cloud API using the documentation. We also provide an API Reference section that lets you visualize and interact with our APIs directly through the browser. Further, complete examples are available on GitHub.

Further, groupdocs.cloud is writing other blog posts on new topics. Therefore, please stay in touch for the latest updates.

Ask a question

Feel free to ask your queries or questions about how to convert PPT to PDF file, via our forum.

FAQs

How do I convert PPT to PDF in Node.js?

Please follow this link to learn the Node.js code snippet for how to convert PPT slide to PDF file quickly and easily.

How to convert PowerPoint to PDF in Node.js using REST API?

Create an instance of ConvertApi, set the values of the convert settings and invoke the convertDocument method with ConvertDocumentRequest to for converting PowerPoint file to PDF.

How to convert PowerPoint to PDF free online?

PPTX to PDF converter online free allows you to import PowerPoint into PDF file, quickly and easily. Once the conversion is completed, you can download the PDF file.

How do I convert PPT to PDF online free?

  • Open online PPT to PDF converter free
  • Click inside the file drop area to upload PowerPoint or drag & drop PowerPoint file.
  • Click on Convert Now button, online PPTX to PDF converter will transform PowerPoint to PDF file.
  • Download link of output file will be available instantly after converting PowerPoint to PDF online.

How to install PPT to PDF online Node.js API?

Install PowerPoint to PDF converter free download Node.js library to create, and convert PowerPoint to PDF programmatically.

How do I convert PowerPoint to PDF in windows?

Please visit this link to download PowerPoint file to PDF converter. This offline converter can be used to convert PowerPoint to PDF in windows, using a single click.

See Also

We recommend you to visit the following articles to learn about: