Here is a Perl script that creates a PDF from list of JPG images. This script uses the PDF::FromImage CPAN module.
#!/usr/bin/env perl # Perl Script to create a PDF file from a sorted list of JPG images # This script uses the PDF::FromImage module. # # To install PDF::FromImage module on Windows with Strawberry Perl # execute the following commands in a Command Shell # The following command assumes Strawberry Perl in PATH # c:\> perl -MCPAN -e shell # c:\> install PDF::FromImage; # # This script assumes there is a list of 300 JPG images with names # in the CURRENT_DIRECTORY in acsending order. # E.g. fileprefix_1.jpg, fileprefix_2.jpg, fileprefix_3.jpg ... # # # Steps to use the script: # 1. Save this script as make_pdf.pl in the directory where you have # the JPG images # 2. Install the Perl Module # 3. Edit the script modify as per requirement # 4. run the script from commandline. # use strict; use PDF::FromImage; my ($prefix, $pdfname, @files) # Enter a prefix for your image files $prefix = 'file_prefix'; # Enter the PDF name without the ".pdf" extension $pdfname = 'my_pdf_name'; for (my $i=1; $i load_images(@files); $p->write_file($pdfname . '.pdf');
Perl Script to create a PDF file from a sorted list of JPG images. This script uses the PDF::FromImage module.
To install PDF::FromImage module on Windows with Strawberry Perl
execute the following commands in a Command Shell. The following command assumes Strawberry Perl in PATH
c:\> perl -MCPAN -e shell
c:\> install PDF::FromImage;
This script assumes there is a list of 300 JPG images with names in the CURRENT_DIRECTORY in ascending order.
E.g. fileprefix_1.jpg, fileprefix_2.jpg, fileprefix_3.jpg …
Steps to use the script:
- Save this script as make_pdf.pl in the directory where you have
the JPG images. - Install the Perl Module.
- Edit the script modify as per requirement.
- Run the script from the command line.
Advertisements