Custome lib from https://www.npmjs.com/package/pdf-poppler author Khishigbaatar N. <kb@2xcoding.com>, need open pdf with password. PDF files into images using Poppler with promises. It achieves 10x faster performance compared to other PDF converters. Pop
npm install pdf-poppler-with-password
$ npm i pdf-poppler-with-password
`
Usage
$3
pdf.removePdfPassword(inputFile, outputFile, password)
$3
`javascript
const pdf = require('pdf-poppler-with-password');
let file = 'C:\\tmp\\convertme.pdf'
pdf.info(file)
.then(pdfinfo => {
console.log(pdfinfo);
});
`
$3
`javascript
const path = require('path');
const pdf = require('pdf-poppler');
let file = 'C:\\tmp\\convertme.pdf'
let opts = {
format: 'jpeg',
out_dir: path.dirname(file),
out_prefix: path.baseName(file, path.extname(file)),
page: null
}
pdf.convert(file, opts)
.then(res => {
console.log('Successfully converted');
})
.catch(error => {
console.error(error);
})
`
$3
`javascript
const path = require('path');
const pdf = require('pdf-poppler');
let file = 'C:\\tmp\\convertme.pdf'
let opts = {
format: 'jpeg',
out_dir: path.dirname(file),
out_prefix: path.baseName(file, path.extname(file)),
page: null,// will proses all page if empty or null value
password:''
}
// convert or just get pdf info
``