How to get PDF info from URL (node for PDF information API in JavaScript using PDF.co Web API

Step By Step Tutorial: how to get PDF info from URL (node for PDF information API in JavaScript

On this page you will learn from code samples for programming in JavaScript. PDF information API in JavaScript can be implemented with PDF.co Web API. PDF.co Web API is the flexible Web API that includes full set of functions from e-signature requests to data extraction, OCR, images recognition, pdf splitting and pdf splitting. Can also generate barcodes and read barcodes from images, scans and pdf.

JavaScript code samples for JavaScript developers help to speed up the application’s code writing when using PDF.co Web API. For implimentation of this functionality, please copy and paste code below into your app using code editor. Then compile and run your app. Tutorials are available along with installed PDF.co Web API if you’d like to dive deeper into the topic and the details of the API.

Trial version of ByteScout is available for free download from our website. This and other source code samples for JavaScript and other programming languages are available.

Try PDF.co Web API today:  60 Day Free Trial (on-premise) or  Web API (on-demand version)

GetPdfInfoFromUrl.js
      
var https = require("https"); // The authentication key (API Key). // Get your own by registering at https://app.pdf.co/documentation/api const API_KEY = "***********************************"; // Direct URL of PDF file to get information const SourceFileUrl = "https://bytescout-com.s3.amazonaws.com/files/demo-files/cloud-api/pdf-info/sample.pdf"; // Prepare request to `PDF Info` API endpoint var queryPath = `/v1/pdf/info?url=${SourceFileUrl}`; var reqOptions = { host: "api.pdf.co", path: encodeURI(queryPath), headers: { "x-api-key": API_KEY } }; // Send request https.get(reqOptions, (response) => { response.on("data", (d) => { // Parse JSON response var data = JSON.parse(d); if (data.error == false) { // Display PDF document information for (var key in data.info) { console.log(`${key}: ${data.info[key]}`); } } else { // Service reported error console.log(data.message); } }); }).on("error", (e) => { // Request error console.error(e); });

Try PDF.co Web API today:  60 Day Free Trial (on-premise) or  Web API (on-demand version)

VIDEO

ON-PREMISE VERSION INFORMATION

Get 60 Day Free Trial or Visit PDF.co Web API Home Page

Explore PDF.co Web API Documentation

Get PDF.co Web API Free Training

WEB API

Get Your Free API Key

Explore Web API Documentation

Related Samples: