In this tutorial, we will show you how to extract bold text from PDF in JavaScript using PDF.co Web API. Below is the image of the source PDF and the extracted bold text output in XML format.

Step 1: Source File and JavaScript Code
To begin, open your Visual Studio app and save the following files:
Step 2: Install Request Module
Next, install the request module for file upload. Type the npm install requests
in the terminal.
Step 3: PDF.co API Key
In line 13, add your API key inside the double quote. You can get the PDF.co API Key in your dashboard here.
Step 4: Source and Destination Files
In line 17, enter your source PDF file and type in your desired XML output file name in line 23.
Step 5: Run Program
Once you complete the setup. Let’s run the program by typing the node app.js
in the terminal.
Extract Bold Text Demo
Here’s a quick demo to extract bold text from PDF.

In these tutorials, you learned how to extract bold text from PDF in JavaScript using PDF.co Web API. You learned how to install the requests module to run the program. You also learned how to use the PDF to XML Web API to extract bold text from PDF.