Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

pdf-merge-multistamp

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pdf-merge-multistamp

Merge PDF files into a single PDF document, with multistamp supported

  • 1.3.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
2
Maintainers
1
Weekly downloads
 
Created
Source

PDFMerge

Merge multiple PDF Files into a single PDF document supporting three output formats: Buffer, Stream, New file on disk.

Requirements

PDFMerge uses PDFtk to merge the documents and as such it is a requirement in order for PDFMerge to work. It will work on any platform supported by PDFtk. Starting from v1.0.0 a requirement of Node >= 4.0.0 is required as well. If you are stuck in the dark ages then npm i pdf-merge@0.1.1 should still work.

Installing PDFtk

Windows

Download and run the Installer.

Debian, Ubuntu
apt-get install pdftk
RPM

https://www.pdflabs.com/docs/install-pdftk-on-redhat-or-centos/

Syntax

PDFMerge(files, options)

files is expected to be an array of files (must be full path for each respective file) or objects.

The file object have the follow options:

  • file Full path of PDF file
  • inputPw Password to decrypt a PDF Optional!

options:

  • libPath Should only be provided if pdftk is not in your PATH Optional!
  • output Defaults to Buffer. Values Buffer, Stream, and path to a new file are accepted. Optional!
  • multistamp Should only be provided if multistamp is used Optional!
  • getMeta Should only be provided to get single file meta Optional!
  • execOptions This is an optional string where you can pass additional argument to pdftk, for example compress. For the complete list see the docu of the pdftk

Examples 1

const PDFMerge = require('pdf-merge');

const files = [
	`${__dirname}/1.pdf`,
	`${__dirname}/2.pdf`,
	{file: `${__dirname}/protected.pdf`, inputPw: '_SeCrEt_'}
];

//Buffer (Default)
PDFMerge(files)
.then((buffer) => {...});

//Stream
PDFMerge(files, {output: 'Stream'})
.then((stream) => {...});

//Save as new file
PDFMerge(files, {output: `${__dirname}/3.pdf`})
.then((buffer) => {...});

Examples 2

const PDFMerge = require('pdf-merge');

const files = [
	`${__dirname}/1.pdf`
];

//Applies each page of the stamp PDF to the corresponding page of the input PDF
PDFMerge(files, {multistamp: `${__dirname}/stamp.pdf`, output: `${__dirname}/3.pdf`})
.then((buffer) => {...});

Examples 2

const PDFMerge = require('pdf-merge');

const files = [
	`${__dirname}/1.pdf`
];

//Applies each page of the stamp PDF to the corresponding page of the input PDF
PDFMerge(files, {getMeta: true})
.then((meta) => {...});

Keywords

FAQs

Package last updated on 18 Dec 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc