How to Reduce PDF File Size in JavaScript

bower install jquery
var form = new FormData();
form.append("inputFile", fileInput.files[0], "file");
var settings = {
"url": "https://api.cloudmersive.com/convert/edit/pdf/optimize/reduce-file-size",
"method": "POST",
"timeout": 0,
"headers": {
"Content-Type": "multipart/form-data",
"Apikey": "YOUR-API-KEY-HERE"
},
"processData": false,
"mimeType": "multipart/form-data",
"contentType": false,
"data": form
};
$.ajax(settings).done(function (response) {
console.log(response);
});

--

--

--

There’s an API for that. Cloudmersive is a leader in Highly Scalable Cloud APIs.

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

REACT Fundamental Talks

Convert EPS to PNG in Node.JS

How to convert a Rasterized PDF into a DOCX in Node.JS

Mustacchio TryHackMe

REDIS NODEJS: EXAMPLE WITH TYPESCRIPT

How to Use Google Place Autocomplete With React Without a Third-Party Library

How to Add Conditional Statements to v-for Loops in Vue.js

Set up VueJS, Tailwind & Laravel — VuTaL Stack for Development

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Cloudmersive

Cloudmersive

There’s an API for that. Cloudmersive is a leader in Highly Scalable Cloud APIs.

More from Medium

Getting Started Node JS

Dockerize your Nodejs Application in 5 minutes

Advantage of web development using Django framework

Chapter 12 : Register Page