2.2.4 • Published 10 months ago

a4pic2pdf v2.2.4

Weekly downloads
-
License
MIT
Repository
github
Last release
10 months 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

10 months ago

2.1.2

10 months ago

2.2.0

10 months ago

2.1.1

10 months ago

2.0.2

10 months ago

2.2.3

10 months ago

2.2.2

10 months ago

2.1.3

10 months ago

2.2.4

10 months ago

2.1.0

10 months ago

2.0.1

10 months ago

2.0.0

10 months 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