Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

NodeJS, Merge two pdfs [closed]

Hy, i have two .pdf and i want to merge them using node, i already tried using Ghostscript, and exec from node , but GhostScript is a bit buggy, and sometimes it gives segmentation fault level 11, which i already researched and its a common bug.

Processing pages 1 through 2.
Page 1
Page 2
Segmentation fault: 11

So my question is if there is a module that can do the merge of two PDF for me, already tried PDFMake , and PDFKit, but i cant seem to find any option to merge files.

Thanks in advance

like image 974
Diogo Antunes Avatar asked Jun 01 '14 17:06

Diogo Antunes


People also ask

Can I combine multiple PDFs into one?

How to combine and merge your files into one PDF: Open Acrobat DC to combine files: Open the Tools tab and select "Combine files." Add files: Click "Add Files" and select the files you want to include in your PDF. You can merge PDFs or a mix of PDF documents and other files.

What does PDF Mergy do?

PDF Mergy is a web app that provides a simple way to merge PDF files. You can either select the files you want to merge from your computer or drop them on the app using drag and drop.

How can we do PDF merging using Javascript?

var merge = require('easy-pdf-merge'); merge(['File One. pdf','File Two. pdf'],'File Ouput. pdf',function(err){ if(err) return console.


1 Answers

A module named pdf-merge worked great for me. It requires a program called PDFtk. Make sure you install the server version of PDFtk.

like image 195
Luc Avatar answered Nov 03 '22 00:11

Luc