Free Node.js Library to Trim, Split & Merge PDF Files
A Powerful Open Source PDF Manipulation Node.js Library that Enables Software Developers to Trim, Split, Join, Crop, Read, Extract (text, images) and Mash PDF Documents in Node.js Environment.
What is Scissors Library ?
While PDFs are the standard for digital documents, manipulating them in a Node.js environment can be challenging. For software developers seeking a powerful solution, Scissors stands out as a premier open source Node.js PDF library. This versatile toolkit acts as a free PDF API, designed to streamline complex PDF processing tasks. Whether you're building a sophisticated document management system or automating reports, Scissors provides a straightforward and efficient way to integrate PDF functionalities directly into your JavaScript applications, saving valuable development time and effort.
This library is packed with essential features to handle any manipulation task with ease. You can effortlessly split PDF documents into separate files or trim PDF files to remove unnecessary pages. It excels at content extraction, allowing you to seamlessly extract PDF text for data analysis or extract images from PDF files for other uses. Furthermore, Scissors empowers you to merge multiple documents, add protective watermarks, encrypt sensitive files with passwords, and optimize PDFs for smaller sizes and faster loading times, making it an indispensable tool for any modern development project.
Getting Started with Scissors
Scissors is available at npm, You can easily download it and install it on your machine. Please use the following command for smooth installation.
Install Scissors Library via npm
npm install scissors-pdf
Splitting PDF Documents inside Node.js Apps
One of the core functionalities of the open source Scissors library is its ability to split PDFs into separate pages with just a couple of lines of code inside Node.js applications. It enables users to divide a PDF document into multiple smaller files based on predefined criteria such as page count, bookmarks, or custom delimiters. Whether you need to extract specific sections of a document or break it down for further processing, Scissors makes this task effortless. The following example shows how software developers can divide PDF documents by bookmarks inside Node.js environment.
How to Split PDF Documents inside Node.js Applications?
const scissors = require('scissors');
scissors.split('input.pdf', 'outputFolder', { splitBy: 'bookmark' });
Extract PDF Text & Images in Node.js
Extracting text enables developers to retrieve the textual content from their PDF document, which can be useful for text analysis or indexing purposes. Extracting images allows software developers to retrieve images embedded within their PDF document, providing opportunities for image processing or content analysis. The open source Scissors makes it easy for software professionals to load and extract content from an existing PDF file inside Node.js applications. The following example demonstrates how software developers can extract images as well as textual content from an existing PDF files inside Node.js applications.
How to Extract Text and Images from PDF Document inside Node.js Applications?
const scissors = require('scissors');
const text = scissors.extractText('input.pdf');
console.log(text);
// Extracting PDF images
const images = scissors.extractImages('input.pdf', { outputDir: 'images' });
console.log(images);
Trimming PDF Files in Node.js
Need to remove unwanted pages from a PDF document? Trimming allows you to remove specific pages from a PDF document, helping you create more concise and focused content. The open source library Scissors makes it a breeze. With just a few lines of code, software developers can trim PDFs to remove unnecessary pages, ensuring that their documents are lean and focused. Here is an example that shows how software developers can trim an existing PDF file inside Node.js environment.
How to Trim PDF Documents inside Node.js Applications?
const scissors = require('scissors');
scissors.trim('input.pdf', 'output.pdf', { pages: '1-5' });