Skip to content

beresfordbear/merge-pdfs-on-browser

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Merge PDFs on browser

Run the demo

npm i -g http-server
http-server public

There are two implementations of PDF merging in this repo:

  1. Using pdfjs - http://localhost:8080/pdfjs-approach/

This approach merges PDF contents. It retains text and images. Text is highlightable etc (i.e it's good, quality wise)

  1. Using canvas - http://localhost:8080/canvas-approach/

This use HTML5 canvas to render the PDF content first and then convert each page to PNG or JPEG and then save it to a new PDF. But this is not only slow, the quality of images maybe not be like merging PDFs properly together.

For building pdfjs approach

npm i -g parcel-bundler
cd public/pdfjs-approach/
parcel pdf-merger-js-adapted.js

For building canvas appraoch

No steps needed. Used Mozilla's pdf.js library from CDN. (Note "pdfjs" is not same as Mozilla's pdf.js. Former is name of an npm module written by "Markus Ast")

About

Merge PDFs on a browser

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 52.9%
  • HTML 47.1%