Closed Ekansh19 closed 1 year ago
This lib cannot get or extract images (like figures or graphs) from pdf, but you can create an image (thumbnail) from whole page:
const options = { page: 1, imageType: 'png', width: 160, height: 226 }
pdf2html.thumbnail('sample.pdf', options, (err, thumbnailPath) => {
if (err) {
console.error('Conversion error: ' + err)
} else {
console.log(thumbnailPath)
}
})
For more advanced manipulations use node-poppler or Mozilla's pdf.js
Like @reregaga mentioned. this library doesn't extract images. Please feel free to do PR if you would like to add this.
Hi,
After converting the pdf to HTML, am getting the same HTML code against all the files(different) and with almost blank body data. jpg2pdf.pdf
Result HTML: