Extract Text from Scanned PDF in JavaScript using PDF.co Web API

In this tutorial, we will show you how to extract text from scanned PDF in JavaScript using PDF.co Web API. Below is the image of our sample scanned PDF and its TEXT output.

Sample Scanned PDF Input
Sample Scanned PDF Input
Text Output
Text Output

Step 1: Source Code

First, copy the JavaScript sample code here and open it in your favorite editor.

Step 2: Add API Key

Next, go to line 21 and add your PDF.co API Key. You can get it in the PDF.co dashboard here.

Add PDF.co API Key

Step 3: Add Source URL

Then, add the scanned PDF URL in line 26.

Source PDF URL

Step 4: Destination File

Finally, add the output file destination in line 32.

Output File Destination

In this tutorial, you learned how to extract text from scanned PDF in JavaScript using PDF.co Web API. You learned how to change the important parameters to get started quickly. You also got a glimpse of how the PDF.co PDF to Text Web API works.