ByteScout Cloud API Server - PDF To Text API - JavaScript - Convert PDF To Text in JQuery - Async API - ByteScout
Announcement
Our ByteScout SDK products are sunsetting as we focus on expanding new solutions.
Learn More Open modal
Close modal
Announcement Important Update
ByteScout SDK Sunsetting Notice
Our ByteScout SDK products are sunsetting as we focus on our new & improved solutions. Thank you for being part of our journey, and we look forward to supporting you in this next chapter!

ByteScout Cloud API Server – PDF To Text API – JavaScript – Convert PDF To Text in JQuery – Async API

  • Home
  • /
  • Articles
  • /
  • ByteScout Cloud API Server – PDF To Text API – JavaScript – Convert PDF To Text in JQuery – Async API

How to convert PDF to text in jquery async API for PDF to text API in JavaScript using ByteScout Cloud API Server

How to convert PDF to text in jquery async API for PDF to text API in JavaScript: Step By Step Instructions

These simple tutorials explain the code material for beginners and advanced programmers who are using JavaScript. PDF to text API in JavaScript can be applied with ByteScout Cloud API Server. ByteScout Cloud API Server is API server that is ready to use and can be installed and deployed in less than 30 minutes on your own Windows server or server in a cloud. It can save data and files on your local server-based file storage or in Amazon AWS S3 storage. Data is processed solely on the API server and is powered by ByteScout engine, no cloud services or Internet connection is required for data processing..

The SDK samples displayed below below explain how to quickly make your application do PDF to text API in JavaScript with the help of ByteScout Cloud API Server. This JavaScript sample code can be used by copying and pasting into your project. Once done,just compile your project and click Run. This basic programming language sample code for JavaScript will do the whole work for you in implementing PDF to text API in your app.

Free! Free! Free! ByteScout free trial version is available for FREE download from our website. Programming tutorials along with source code samples are assembled.

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

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

converter.js
      
// Please NOTE: In this sample we're assuming Cloud Api Server is hosted at "https://localhost". // If it's not then please replace this with with your hosting url. var formData, toType, isInline; $(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 formData = $("#form input[type=file]")[0].files[0]; // file to upload toType = $("#convertType").val(); // output type isInline = $("#outputType").val() == "inline"; // if we need output as inline content or link to output file $("#status").html('Requesting presigned url for upload... &nbsp;&nbsp;&nbsp; <img src="ajax-loader.gif" />'); $.ajax({ url: 'https://localhost/file/upload/get-presigned-url?name=test.pdf&contenttype=application/pdf&encrypt=true', type: 'GET', success: function (result) { if (result['error'] === false) { var presignedUrl = result['presignedUrl']; // reading provided presigned url to put our content into $("#status").html('Uploading... &nbsp;&nbsp;&nbsp; <img src="ajax-loader.gif" />'); $.ajax({ url: presignedUrl, // no api key is required to upload file type: 'PUT', headers: { 'content-type': 'application/pdf' }, // setting to pdf type as we are uploading pdf file data: formData, processData: false, success: function (result) { $("#status").html('Processing... &nbsp;&nbsp;&nbsp; <img src="ajax-loader.gif" />'); $.ajax({ url: 'https://localhost/pdf/convert/to/' + toType + '?url=' + presignedUrl + '&encrypt=true&inline=' + isInline + '&async=True', type: 'POST', success: function (result) { if (result.error) { $("#status").text('Error uploading file.'); } else { checkIfJobIsCompleted(result.jobId, result.url); } } }); }, error: function () { $("#status").text('Error'); } }); } } }); }); function checkIfJobIsCompleted(jobId, resultFileUrl) { $.ajax({ url: 'https://localhost/job/check?jobid=' + jobId, type: 'GET', success: function (jobResult) { $("#status").html(jobResult.status + ' &nbsp;&nbsp;&nbsp; <img src="ajax-loader.gif" />'); if (jobResult.status == "working") { // Check again after 3 seconds setTimeout(function(){ checkIfJobIsCompleted(jobId, resultFileUrl); }, 3000); } else if (jobResult.status == "success") { $("#status").text('Done converting.'); $("#resultBlock").show(); if (isInline && toType != "xls" && toType != "xlsx") { $.ajax({ url: resultFileUrl, dataType: 'text', success: function(respText){ $("#inlineOutput").text(respText); } }); } else { $("#result").attr("href", resultFileUrl).html(resultFileUrl); } } } }); }

ON-PREMISE OFFLINE SDK

60 Day Free Trial or Visit ByteScout Cloud API Server Home Page

Explore ByteScout Cloud API Server Documentation

Explore Samples

Sign Up for ByteScout Cloud API Server 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 ByteScout Cloud API Server Home Page

Explore ByteScout Cloud API Server Documentation

Explore Samples

Sign Up for ByteScout Cloud API Server Online Training

ON-DEMAND REST WEB API

Get Your API Key

Explore Web API Docs

Explore Web API Samples

Tutorials:

prev
next