wubzz / pdf-merge

Merge multiple PDF Files into a single PDF document
127 stars 32 forks source link

Support PDF file protected with password #27

Closed efernandesng closed 5 years ago

efernandesng commented 5 years ago

Hi!

Would be nice if we can merge pdf files protected with password.

Example:

const PDFMerge = require('pdf-merge');

const files = [
    `${__dirname}/1.pdf`,
    `${__dirname}/2.pdf`,
    {file: `${__dirname}/protected.pdf`, inputPw: '_secret_'},
];

//Buffer (Default)
PDFMerge(files)
.then((buffer) => {...});

//Stream
PDFMerge(files, {output: 'Stream'})
.then((stream) => {...});

//Save as new file
PDFMerge(files, {output: `${__dirname}/3.pdf`})
.then((buffer) => {...});

If you think this feature is useful, I can make a PR.

wubzz commented 5 years ago

Sounds like a good addition, go for it!