A simple library to convert any PDF into a image on Node.js
- ✅ Node.js >= 16
- 🔀 Multiple output formats (PNG, JPEG, BMP, GIF, TIFF)
- Install&Go 🚀🚀 doesn't require any extra binaries to be installed/build on your system.
Node.js
import { IMG_ALLOWED_FORMATS, convertDocumentToImage } from 'pdf-to-image';
const pdfFile = fs.readFileSync('./sample.pdf');
const result = await convertDocumentToImage(pdfFile, 'PNG');
fs.writeFileSync('out.png', result);