How to merge PDF documents (jquery) for PDF merging API in JavaScript with PDF.co Web API

How to merge PDF documents (jquery) in JavaScript with easy ByteScout code samples to make PDF merging API. Step-by-step tutorial

Today we will explain the steps and algorithm of how to merge PDF documents (jquery) and how to make it work in your application. PDF merging 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.

The SDK samples like this one below explain how to quickly make your application do PDF merging API in JavaScript with the help of 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. This basic programming language sample code for JavaScript will do the whole work for you in implementing PDF merging API in your app.

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.

On-demand (REST Web API) version:
 Web API (on-demand version)

On-premise offline SDK for Windows:
 60 Day Free Trial (on-premise)

merge.js
      
$(document).ready(function () { $("#resultBlock").hide(); $("#errorBlock").hide(); $("#result").attr("href", '').html(''); }); $(document).on("click", "#submit", function () { $("#resultBlock").hide(); $("#errorBlock").hide(); $("#inlineOutput").text(''); // inline output div $("#status").text(''); // status div var apiKey = $("#apiKey").val().trim(); //Get your API key at https://app.pdf.co/documentation/api var formData = new FormData(); formData.append('name', 'result.pdf'); // Append files in input request formData.append('file[]', $("#form input[type=file]")[0].files[0]); formData.append('file[]', $("#form input[type=file]")[1].files[0]); $("#status").html('Processing... &nbsp;&nbsp;&nbsp; <img src="ajax-loader.gif" />'); $.ajax({ url: 'https://api.pdf.co/v1/pdf/merge', type: 'POST', headers: { 'x-api-key': apiKey }, data: formData, contentType: false, // NEEDED, DON'T OMIT THIS (requires jQuery 1.6+) processData: false, // NEEDED, DON'T OMIT THIS success: function (result) { $("#status").text('Success!'); $("#resultBlock").show(); $("#inlineOutput").html('<iframe style="width:100%; height:500px;" src="'+ result.url +'" />'); }, error: function () { $("#status").text('error'); } }); });

ON-PREMISE OFFLINE SDK

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

Explore PDF.co Web API Documentation

Explore Samples

Sign Up for PDF.co Web API Online Training

ON-DEMAND REST WEB API

Get Your API Key

Explore Web API Docs

Explore Web API Samples

VIDEO

ON-PREMISE OFFLINE SDK

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

Explore PDF.co Web API Documentation

Explore Samples

Sign Up for PDF.co Web API Online Training

ON-DEMAND REST WEB API

Get Your API Key

Explore Web API Docs

Explore Web API Samples

Related Samples: