1.0.7 • Published 11 months ago

pdf-mania v1.0.7

Weekly downloads
-
License
ISC
Repository
-
Last release
11 months ago

pdfMania

Overview

pdfMania is a Node.js CLI tool that allows you to convert files to PDF format and merge multiple files into a single PDF. This tool is designed to be simple and efficient, making it easy to perform these operations directly from the command line. Additionally, the core functions can be used in JavaScript projects.

Installation

To install pdfMania, you can use npm:

npm install -g pdf-mania

Usage

CLI Usage

Convert a File to PDF

To convert a file to PDF format, use the convert command followed by the input file and the desired output file.

pdfMania convert <input> <output>

Example:

pdfMania convert document.docx output.pdf

Merge Multiple Files into a Single PDF

To merge multiple files into a single PDF, use the merge command followed by the input directory containing the files and the desired output file.

pdfMania merge <input_directory> <output>

Example:

pdfMania merge ./documents merged.pdf

JavaScript API Usage

You can also use the core functions of pdfMania in your JavaScript projects. Convert a File to PDF

To convert a file to PDF format programmatically, use the convertToPdf function.

const { convertToPdf } = require('pdfMania');

convertToPdf('document.docx', 'output.pdf')
  .then(() => console.log('Conversion completed'))
  .catch(err => console.error('Conversion failed:', err.message));

Merge Multiple Files into a Single PDF

To merge multiple files into a single PDF programmatically, use the mergeDocumentsToPdf function.

const { mergeDocumentsToPdf } = require('pdfMania');

mergeDocumentsToPdf('./documents', 'merged.pdf')
  .then(() => console.log('Merge completed'))
  .catch(err => console.error('Merge failed:', err.message));
1.0.7

11 months ago

1.0.6

11 months ago

1.0.5

11 months ago

1.0.4

11 months ago

1.0.3

12 months ago

1.0.2

12 months ago

1.0.1

12 months ago

1.0.0

12 months ago