pdfmerge

    1.0.2 • Public • Published

    PDFMergeJS

    npm version

    Merge PDF files into one.

    What's new

    1. PDFMerge is now promise based.
    2. Better error handling.

    Requirements

    1. Python 3 or above
    2. PyPDF2 >= 1.21
    To install PyPDF2, run pip install PyPDF2>=1.21

    Usage

    1. Install the module using npm install pdfmerge

    2. Require the module

      let PDFMerge = require('pdfmerge')
    3. PDFMerge(inputFiles, outputFile) - function

      • inputFiles - Array : An Array of all the input files
      • outputFile - String : String containing the output filename
    4. Example code:

      PDFMerge(['input-1.pdf', 'input-2.pdf'], 'output.pdf').then(function(done){
          console.log(done) // success
      }).catch(function(error){
          console.error(error.code) // Logs error code if an error occurs
      })

      error.code returns :

      • 404 - If any or all of the input files are not found
      • 1 - If PyPDF2 is not installed

    Thanks to pdfmerge

    MIT © 2017-2019 Akash Rajendra

    Install

    npm i pdfmerge

    DownloadsWeekly Downloads

    673

    Version

    1.0.2

    License

    MIT

    Unpacked Size

    11 kB

    Total Files

    7

    Last publish

    Collaborators

    • akashrajendra