Open siamraj opened 6 years ago
Hey @siamraj,
You have this problem because the convert process didn't worked.
The error message might can be optimised here but primarily you have to fix the convert command.
Try this on your command line - this will fail:
convert "test.pdf[1]" "test-0.png"
You already found: #30
Try to install pdf-poppler
or poppler
with brew
as described in readme
My Code : var fs = require('fs'); var PDFImage = require("pdf-image").PDFImage;
var pdfImage = new PDFImage("test.pdf"); pdfImage.convertPage(0).then(function (imagePath) { // 0-th page (first page) of the slide.pdf is available as slide-0.png fs.existsSync("Public/slide-0.png") // => true }).catch((err)=>{ console.log(err) });
Error MSG :
{ message: 'Failed to convert page to image', error: { Error: Command failed: convert "test.pdf[0]" "test-0.png" Invalid Parameter - "test-0.png"
stdout: '', stderr: 'Invalid Parameter - "test-0.png"\r\n' }