In this tutorial, we’ll be observing the PDF to JSON conversion using ByteScout API Server.

These are the some of the useful links, which are:

  1. API Server Documentation
  2. API Server Base URL. This is our IIS-hosted URL of the API Server publish package.
  3. Link to input sample PDF file.

PDF to JSON with API Server

Let’s get started!

First of all, let’s visit documentation and get hold of the endpoint for PDF to JSON convert. Here it is! It’s ‘/pdf/convert/to/json’. For this demo, we’ll be using a GET request; however, it’s recommended we should use a POST request for the production environment.

Convert PDF to JSON

If we review parameters, mainly it requires input document URL in ‘url’ parameter. Please make sure that the input URL is accessible from API Server.

Now, let’s review the input PDF file. Input PDF contains product information in tabular format. We have the product names, units, and prices; at the bottom, we have the total units and the sum of all prices.

Input PDF File

Okay! We’ll be building a GET request URL in the browser itself. Let’s have a base URL and append an endpoint URL for PDF to JSON conversion. In the end, let’s pass the input file URL as a query string.

With the full request URL complete, let’s execute it. And, here’s our response. Fast! Isn’t it?

Output JSON File

Let’s review the output URL, which points to generated JSON. In the output, we see that it contains a table header, all rows of product data; as well as footer information. Everything is neatly formatted JSON. We’ve configured API Server with demo keys; that’s a reason some of the data has watermarks.

Well, that’s it! It’s that easy to convert PDF to JSON using API Server.