Created
September 9, 2016 08:57
-
-
Save valchonedelchev/d43bf11b8d5f7262223cb1fd392cadd0 to your computer and use it in GitHub Desktop.
JPG to PDF automation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env perl | |
use strict; | |
use warnings; | |
use feature 'say'; | |
use Path::Tiny; | |
use File::Basename; | |
foreach my $jpg (path(".")->children(qr/\.jpg$/)) { | |
my $pdf = fileparse($jpg, 'jpg') . 'pdf'; | |
my @cmd = ('sips', '-s', 'format', 'pdf', $jpg, '--out', "pdf/$pdf"); | |
say join(' ', @cmd); | |
system(@cmd); | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment