2.2.4 • Published 1 year ago

a4pic2pdf v2.2.4

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

https://www.npmjs.com/package/a4pic2pdf

  • 輸出會強制覆蓋
  • pdfFilename 不能有 .pdf 副檔名
const path = require('path');
const fs = require('fs');

const a4pic2pdf = require('a4pic2pdf');

// Check if there are enough command line arguments
if (process.argv.length < 5) {
    console.log('Usage: node script.js imgInputDir outputDir pdfFilename');
    process.exit(1);
}

// Get the command line arguments
const imgInputDir = process.argv[2];
const outputDir = process.argv[3];
const pdfFilename = process.argv[4];

// Filter and select only files with the specified extensions
const allowedExtensions = ['.jpg', '.jpeg', '.png', '.webm'];
const filesToUpload = fs.readdirSync(imgInputDir)
    .filter(file => allowedExtensions.includes(path.extname(file).toLowerCase()))
    .map(file => path.join(imgInputDir, file));

const outputLocationDir = path.join(process.cwd(), outputDir);

a4pic2pdf(filesToUpload, outputLocationDir, pdfFilename);
2.2.1

1 year ago

2.1.2

1 year ago

2.2.0

1 year ago

2.1.1

1 year ago

2.0.2

1 year ago

2.2.3

1 year ago

2.2.2

1 year ago

2.1.3

1 year ago

2.2.4

1 year ago

2.1.0

1 year ago

2.0.1

1 year ago

2.0.0

1 year ago

1.0.2

2 years ago

1.0.1

2 years ago

0.0.3

2 years ago

0.0.2

2 years ago

0.0.1

2 years ago