combine-multiple-pdfs
Combine or Merge multiple Pdfs into single a Pdf
Table of Contents
Why?
I needed a simple way to combine multiple pdf files into a single pdf file.
Installation
$ npm i combine-multiple-pdfs -S
Functions
Take a look into the usage section for a detailed example.
combinePdfs
Note: you can also use the default export.
This function Takes Array of file paths and converted into a sigle new buffer.
Syntax
Returns a new pdf file buffer.
const newBuffer = ;
Parameters
- data: an array of strings of files
- options: a object (optional)
- holds two keys: outName and outPath
- outName: output file name (optional parameter)
- outPath: output file path (optional parameter) default:
data files path
Usage
An example how to use it.
const combinePdfs = ;/* or */const combinePdfs = ; let data = "./dummy.pdf" "./dummy1.pdf";/* Minimum two files required */ let options = outName: "mergedPdf" outPath: "./public" ; let newFileBuffer = ;