jn-pdf
v1.0.14
Published
This little command line utility scans pwd and merges all image files sorted by name into a single PDF file.
Downloads
31
Maintainers
Readme
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 -g
Usage
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-pdf
This 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-pdf
Save 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 ofcommand
to"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-lib
for creating PDF files.glob
for pattern matching to find image files.commander
for handling command-line arguments.canvas
for 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.