Skip to content

manueldilullo/image_to_pdf

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 

Repository files navigation

png_to_pdf

Simply converter from png to pdf and vice versa.
With this script you can choose if create a pdf using a set of images or to split a pdf in pages and save them as images.

  • The default way to run this script is merging images in one pdf, using -i and -o arguments.
  • If you want to do che opposite process you must use -p , -o , -r y arguments.

Source and destination args are mandatory. You can also choose if delete the elements from source after the conversion.

Requirements

To use this script you must install the following modules

pdf2image==1.14.0
Pillow==8.0.1

Also, to use pdf2image, you need to download poppler, and add bin folder to PATH.

pip install python-poppler

Usage

The script was built to being used from terminal/cmd. If you want to build a pdf from images, a simple usage is the following:

main.py -i <source> -o <destination>

If you want to split a pdf in images, you have to use this syntax:

main.py -p <source> -o <destination> -r y

The options are:

-i, --image_source_folder  'Source from which to take image'
-p, --pdf_source           'Source from which to take .pdf files'
-o, --destination_folder   'Destination where to save .pdf or images files'
-d, --delete_after_run,    'Choose if delete files after conversion [y/n], DEFAULT: n'
-r, --reverse              'If yes, splits pdf in images, else vice versa [y/n], DEFAULT: "n"'

License

GNU General Public License v3.0

About

Simply converter from png to pdf and vice versa

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages