pdf to image javascript 1

pdf to image javascript

$("#download-image").on('click', function() {
	// For IE 10 & 11
	if(typeof window.navigator.msSaveBlob === 'function')
		window.navigator.msSaveBlob(new Blob( [__CANVAS.msToBlob()], {type: 'image/png'} ), 'page.png');
		$(this).attr('href', __CANVAS.toDataURL()).attr('download', 'page.png');

Here is what the above code is Doing:
1. When the user clicks on the “Download” button, the code checks if the browser is IE 10 or 11. If it is, it uses the msSaveBlob() method to save the image. Otherwise, it sets the href attribute of the button to the data URL of the canvas and sets the download attribute to “page.png”.

Similar Posts