Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Javascript file upload - PDF to image(s)

So I have some code where you upload a PDF and it displays it using the browser's built-in PDF reader.

I was wondering if there was any way to take an uploaded PDF and convert it to an image or images.

like image 672
TheProgrammedDev Avatar asked Mar 06 '26 08:03

TheProgrammedDev


1 Answers

Try PDF.js will let you render the PDF to a canvas. PDF.js GitHub

var img = new Image();
img.src = pdfCanvas.toDataURL();

like image 157
sathish kumar Avatar answered Mar 08 '26 22:03

sathish kumar



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!