In this tutorial, we’re going to see the PDF information API. There are many cases when we want to know the information regarding the PDF. Then this API can be useful. Information like how many pages count in the PDF, who is author of this PDF, what’s the title of the PDF etc. You can also find out if there are any bookmarks or keywords.

We can provide input in two ways. We can either provide the file or we can directly provide the URL. If the PDF is encrypted, we can provide the password here and as obvious we’re going to provide the API key in the headers. This is the node JS program. We have placed holder for the API keys, we have the input PDF here, which we will utilize. We are preparing the query for this.

PDF Information API

We are directly providing the file into the file key parameter and physically we are creating the read stream and provide the Input path. So which basically converts the file into the blob and going to send as a form of data. So upon the response, we’re going to see whether it succeeded or not. Then we are going to get all the information we received about the input PDF file in going to explain to the console. The API keys are already placed here and the terminal is fired.

Command, ready, node file name. So, basically you will require to install the required modules which will be done here with NPM request installed.

PDF Information API Tutorial

Once it’s done, it’s uploading the file and we get the response. The response includes one-page count, author, title, the producer, subjects.

So basically we got all the basic information about the PDF. So it’s easy to know the PDF information by using the PDF.co API.

GET YOUR API KEY Zapier plugin  Explore API Docs

Check this PDF.co video tutorial using PDF.co Web API and follow us on YouTube!

PDF.co video tutorial

 

PDF.co REST Web API tutorials

Related Pages: