PDFManager

Description

This program is designed to process PDF files by removing specific pages from them depending on their page count.

Installation

  1. Make sure you have Node.js installed.
  2. Copy the contents of the index.js file into your project.
  3. Install the necessary dependencies using the command npm install pdf-lib fs.

Usage

  1. Place the PDF files that need to be processed in folders in the specified format.
  2. Run the program, specifying the path to the root folder containing the folders with PDF files.
  3. The program will automatically process all PDF files according to the specified logic of page removal.

Running the Program Example

node index.js

Function Descriptions

  1. removePages(filename, currPath): Function to remove pages from a PDF file depending on the number of pages.

  2. getDirectories(path): Function to get a list of folders in the specified directory.

Parameters:

  • filename: Name of the PDF file.
  • currPath: Path to the current folder.

Notes

  • The program works with PDF files located in the specified folders and does not modify the original files, but creates copies with modified pages.
  • Before using, make sure you have all the necessary dependencies installed and that the paths to files and folders are correctly specified.

Author

Yevhen Stuzhuk