combine-multiple-pdfs

1.0.4 • Public • Published

combine-multiple-pdfs

npm master branch Codecov branch

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 = combinePdfs(data, options);
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 } = require("combine-multiple-pdfs");
/* or */
const combinePdfs = require("combine-multiple-pdfs");
 
let data = ["./dummy.pdf", "./dummy1.pdf"];
/* Minimum two files required */
 
let options = { outName: "mergedPdf", outPath: "./public" };
 
let newFileBuffer = combinePdfs(data, options);

/combine-multiple-pdfs/

    Package Sidebar

    Install

    npm i combine-multiple-pdfs

    Weekly Downloads

    3

    Version

    1.0.4

    License

    ISC

    Unpacked Size

    3.89 kB

    Total Files

    3

    Last publish

    Collaborators

    • sai_jeevan_balla