A command line tool for converting PDF to images.


Keywords
pdf, nodejs, pdf-to-pic, pdf-to-image, fpdf2pic, convert, cli, npm, jpg, node, pdf-convert, pdf-parse, pdf2pic
License
Apache-2.0
Install
npm install fpdf2pic@0.5.8

Documentation

fpdf2pic

license Build Status Sourcegraph node NPM version Release Date npm download

A command line tool for converting PDF to images.

show help converting

Prerequisite

Installation

npm i fpdf2pic -g

Usage

# Show help
fpdf2pic -h

# Convert a single PDF to the output directory
fpdf2pic -i ./test.pdf -o ./tmp/output_dir

# All PDF files to the output directory in the conversion directory
fpdf2pic -i ./pdf_file_dir -o ./tmp/output_dir

Help

By default, fpdf2pic The images will be converted to the folder where the PDF is located when the output path is not specified.

The following options are available:

-h, --help                          Shows this help message

-d, --debug                         Show debugging information

-v, --version                       Displays the current version of fpdf2pic

-i, --input-path                    To convert the PDF file path, you can be a single file or folder path

-o, --output-dir                    the directory to output the images, The default will convert all pages, eg: -o ./pdf_images

-P, --page-range                    The page range to convert,  eg: -P 1,3、 -P 1

-W, --width                         The max width of the image to be converted, eg: -W 1024

-H, --height                        The max height of the image to be converted, eg: -H 768

-F, --format                        The format of the image to be converted, eg: -F png

-Q, --quality                       The quality of the image to be converted, eg: -Q 80

-D, --density                       The density of the image to be converted, eg: -D 300

-C, --compression                   The compression method of the image to be converted, eg: -C jpeg

FAQ

How to install graphicsmagick?

See installation.

In Mac OS X, you can simply use Homebrew and do: brew install graphicsmagick

Author

twitter/funnyzak
funnyzak

License

MIT License © 2022 funnyzak