This Node.js application allows for the conversion of TIFF images to PDF format and subsequently merges multiple PDF documents into a single PDF file. It's designed to streamline the process of handling TIFF files and preparing them for easy distribution or archiving in the PDF format.
Before you begin, ensure you have the following installed on your system:
Node.js (version 12.x or later recommended) npm (usually comes with Node.js)
To set up the application on your local machine, follow these steps:
- Clone the repository to your local machine:
git clone https://github.com/naturuplift/ConvertTIFFtoPDF
cd your-repository-directory
- Install the necessary Node.js packages:
npm install
This command installs all dependencies defined in package.json, including pdf-lib and sharp for PDF manipulation and image processing.
To convert TIFF files to PDF and merge them into a single document, follow these steps:
-
Place your TIFF files in the assets directory. Ensure they are named sequentially (e.g., "File 1.tif", "File 2.tif", etc.).
-
Run the application:
node app.js
Replace app.js with the actual entry point of your application if different.
- The application will convert each TIFF file to a PDF, then merge all resulting PDFs into a single file named merged.pdf in the assets directory.
To customize the input or output file paths, edit the convertTiffToPdf function in your script, modifying the tiffPath and pdfPath variables as needed.
- pdf-lib: For creating and manipulating PDF files.
- sharp: For converting TIFF images to a format suitable for embedding in PDFs.
Contributions to the project are welcome: Fork the project. Create your feature branch (git checkout -b feature/AmazingFeature). Commit your changes (git commit -m 'Add some AmazingFeature'). Push to the branch (git push origin feature/AmazingFeature). Open a pull request.
This project is licensed under the MIT License. See the LICENSE file for details.