I need to convert pdf presentation into jpg or png files. Can I do this using PDF.js? |
Is this what you need? image.src = canvas.toDataURL('image/png'); |
I has a typical PDF presentation and I want receive a bunch of jpg. One slide one image. |
pdf.js displays each pdf page on a canvas element. You can get the base64 of the canvas with canvas.toDataURL('image/png') (or jpg) Mass of fermenting dregs world is yours album. If you can use a server side script, imagemagick is more suitable: http://linuxers.org/quick-tips/convert-pdf-file-single-image-using-imagemagick |
I think ImageMagick perfectly suits your needs. pdf.js is a PDF viewer, not a converter. You might be able to get the image from the canvas, but that's more complicated. |