jn-pdf v1.0.14
jn-pdf
A command-line utility that scans files in the current directory, sorts them by name, and merges all images into a single PDF file named after the directory.
Installation
You can install jn-pdf globally using npm:
npm i jn-pdf -gUsage
After installing globally, you can use jn-pdf in any directory containing image files. Navigate to the directory you want to convert and run:
jn-pdfThis will create a PDF file named after the current directory, containing all images sorted by name.
Windows Explorer Integration (Optional)
You can add a context menu option in Windows File Explorer to use jn-pdf directly from the right-click menu.
Create a batch script
jn-pdf.bat:@echo off cd /d %1 jn-pdfSave the batch script in a directory included in your system's PATH.
Add the following registry entries:
- Open the Registry Editor (
regedit). - Navigate to
HKEY_CLASSES_ROOT\Directory\Background\shell. - Create a new key named
jn-pdf. - Set the
(Default)value toMerge Images to PDF. - Under
jn-pdf, create a key namedcommand. - Set the
(Default)value ofcommandto"C:\path\to\jn-pdf.bat" "%V".
- Open the Registry Editor (
Once set up, you can right-click in any folder and select "Merge Images to PDF" to run jn-pdf.
Dependencies
pdf-libfor creating PDF files.globfor pattern matching to find image files.commanderfor handling command-line arguments.canvasfor loading images in the Node.js environment.
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
License
This project is licensed under the MIT License - see the LICENSE file for details.