Skip to content

Commit

Permalink
first commit
Browse files Browse the repository at this point in the history
  • Loading branch information
amanp18 committed May 17, 2024
0 parents commit f65dc7a
Show file tree
Hide file tree
Showing 19 changed files with 1,047 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node_modules
Binary file added README.md
Binary file not shown.
16 changes: 16 additions & 0 deletions merge.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
const path = require('path');

const mergePdfs = async (pdf1, pdf2) => {
const { default: PDFMerger } = await import('pdf-merger-js');
const merger = new PDFMerger();
await merger.add(pdf1);
await merger.add(pdf2);
let timestamp = new Date().getTime();
let outputPath = path.join(__dirname, `public/${timestamp}.pdf`);
await merger.save(outputPath);
return `${timestamp}.pdf`;
};

module.exports = { mergePdfs };


Loading

0 comments on commit f65dc7a

Please sign in to comment.