This tutorial and the sample source code explain extracting valuable information from any PDF using the PDF Info functionality from Web API. The tutorial provides a guideline for the complete extraction process using the Javascript programming language. The users can use PDF Info Reader API to efficiently extract the required information from any PDF document required and use it however they want.

  1. Features of PDF Info Reader API Endpoint
  2. Endpoint Parameters
  3. How to Extract PDF using API in JavaScript
  4. Quick Guide to Extract Information From PDF Forms Using Web API

Features of PDF Info Reader API Endpoint

The Web API provides tools to extract any required information from a provided PDF document effectively. The Info Reader API endpoint works efficiently by gathering detailed information about any PDF document. The users can even have information regarding its properties and the security permissions used by the document.

Moreover, the API allows checking information, including PDF form fields. The PDF form can include checkboxes, list boxes, text fields,  radio boxes, and combo boxes. The users can use this page for one-time checking of such information. Below is a detailed demo explaining these features to help users comprehend them thoroughly.

One of the best features of the Web API is that it provides high security for its users. The API maintains security by transmitting the user’s documents and data files via encrypted connections. Users can learn more about the API security here.

Endpoint Parameters

Following is a comprehensive explanation of the available parameters of the PDF Info Reader API for better user understanding.

  1. url: It is a required parameter that contains the link to the source file. It provides the URL of the input PDF document from which the users want to extract information. The users can provide the source file link from various platforms supported by the API, such as Dropbox, Google Drive, or the built-in file storage of Web API. The users can encrypt or decrypt any input or output data file using the user-controlled data encryption functionality.

Note: If the users are getting error messages like “Too many Requests” and “Access Denied” while providing the input URL, they can add a cache to enable built-in caching functionality.

  1. httpusername: It is an optional parameter that takes the http auth user name if it is necessary to access the source URL.
  2. httppassword: It is an optional parameter that takes the http auth password if it is required to access the source file.
  3. async: It is an optional parameter used for asynchronous processing. This parameter returns a job ID the user might need to check the background job’s status. The possible states of the background job can be failed, working, success, or aborted. It is a boolean parameter that can either be true or false.
  4. profiles:  It is an optional parameter that must be a string. The users can set additional customized configurations for file tuning and extra options using this parameter.

How to Extract PDF using API in JavaScript

The following source code shows users how to extract information from a sample PDF document using the Info Reader API. The sample code in Javascript shows how to gather relevant information from a PDF sample document. The users can upload their respective documents or provide a link to them in the URL parameter to collect valuable data. The users can have information such as text fields, page count, permissions, checkboxes, and many others.

The code contains a sample PDF form as an example here. The users must provide a generated API key by logging into the platform login and the pdf file URL in the API request for the API to work. Moreover, the API returns the resulting output of the provided file URL from which the user can separate required information such as the author, page number, password, permissions, bookmarks, and information regarding the PDF content.

Sample Code Snippet for PDF Extraction

Following is an example code to extract information from a PDF form using Web API:

var https = require("https");
const API_KEY = "***********";

// Direct URL of source PDF file.  
const SourceFileUrl = "";

// Prepare request to `Replace Text from PDF` API endpoint
var queryPath = `/v1/pdf/info`;

// JSON payload for api request
var jsonPayload = JSON.stringify({
    url: SourceFileUrl

var reqOptions = {
    host: "",
    method: "POST",
    path: queryPath,
    headers: {

        "x-api-key": API_KEY,
        "Content-Type": "application/json",
        "Content-Length": Buffer.byteLength(jsonPayload, 'utf8')

// Send request
var postRequest = https.request(reqOptions, (response) => {
    response.on("data", (d) => {
        // Parse JSON response
        var data = JSON.parse(d);
        if (data.error == false) {
        else {

            // Service reported error

}).on("error", (e) => {
    // Request error

// Write request data

Source File

Below is the screenshot of the source file used for this example.

Extract PDF Information

Output of Extracted PDF

Below is the screenshot of the output provided after the execution of the above sample code.

Extract PDF in JavaScript

How to Extract Info from PDFs – Demo

Below is the video to demonstrate the working of the code:
Demo - Extract Information from PDFs using Web API in JavaScript

Quick Guide to Extract Information From PDF Forms Using Web API

Following is a sample guide to explain to the users the working of sample code for extracting information using the Info Reader API endpoint:

  1. The users must import the necessary packages to send API requests. The “require” parameter represents all the crucial modules. On the other hand, “request” is an essential Node.js module that helps make an HTTP call. In this scenario, the required package is “path”.
  2. After logging in to the website, the users can obtain their respective API keys to access their Web API. The users can not send a direct request, so they have to use this specific API key as an access token in the header for authentication.
  3. Since the users might have to use the code several times, the best approach is to use the API key in variable declaration. This approach allows users only to change the variable and edit the complete code file without changing anything in the actual code.
  4. The next step is to declare and initialize the source file and query path variables for the document to extract critical information from it. The query path contains the information of the relevant API endpoint the users have to utilize in the scenario.
  5. The users have to provide the relevant information in the JSON payload. For example, the field names, page numbers, and the information to be added. Here the code provides only the source URL.
  6. The users can use the “async” parameter if the file is large. It will help run the process asynchronously for smooth working.
  7. The users must declare a variable to provide API options such as API endpoint URL, method, and headers. The code contains “reqOptions” for initializing such information in this example.
  8. The next and final step is to send the POST request to the API endpoint and wait for its response. The status 200 represents the successful request, and the code provides the required output after execution. However, if the request is unsuccessful, the users can modify and execute the code again.