Convert PDF to Excel using REST API in Node.js

How to convert PDF to Excel using REST API in Node.js
Convert PDF to Excel using REST API in Node.js

You can convert PDF to spreadsheet of popular formats such as XLSX programmatically on the cloud. As a Node.js developer, you can easily convert PDF file to Excel spreadsheet in your Node.js applications. This article will be focusing on how to convert PDF to Excel using REST API in Node.js.

The following topics shall be covered in this article:

PDF to Excel Conversion REST API and Node.js SDK

I will be using the Node.js SDK of GroupDocs.Conversion Cloud API for converting PDF to XLSX. The API allows you to convert your documents to any format you need. It supports the conversion of over 50 types of documents and images such as Word, Excel, PowerPoint, PDF, HTML, JPG, PNG, CAD. It also provides .NET, Java, PHP, Ruby, Android, and Python SDKs as its document conversion family members for the Cloud API.

You can install GroupDocs.Conversion Cloud to your Node.js applications using the following command in the console:

npm install groupdocs-conversion-cloud

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

Convert PDF to XLSX format using REST API in Node.js

You can convert PDF to Excel format by following the simple steps given below:

  1. Upload the PDF file to the Cloud
  2. Convert PDF to Excel image using Node.js
  3. Download the converted Excel file

Upload the Image

Firstly, upload the excel file to the Cloud using the following code sample:

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

Convert PDF to Excel using Node.js

Please follow the steps mentioned below to convert PDF to XLSX file programmatically:

  • Create an instance of ConvertApi
  • Create ConvertSettings instance
  • Set the PDF file path
  • Assign “xlsx” to format
  • Provide output file path
  • Create ConvertDocumentRequest
  • Get results by calling the ConvertApi.convertDocument() method

The following code example shows how to convert PDF file to Excel format using REST API in Node.js:

How to convert PDF to Excel using Node.js
Convert PDF to Excel using Node.js

Download the Converted File

The above code sample will save the converted excel file on the cloud. You can download it using the following code sample:

Online PDF to Excel Converter Free

Please try the following free online pdf to excel converter, which is developed using the above API.

Conclusion

In this article, you have learned:

  • how to convert PDF to Excel format on the cloud;
  • programmatically upload the PDF file and then download the converted excel file from the cloud;

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.

Ask a question

You can ask your queries about how to convert PDF into XLSX format, via our Free Support Forum

See Also