Skip to content

Instantly share code, notes, and snippets.

@valchonedelchev
Created September 9, 2016 08:57
Show Gist options
  • Save valchonedelchev/d43bf11b8d5f7262223cb1fd392cadd0 to your computer and use it in GitHub Desktop.
Save valchonedelchev/d43bf11b8d5f7262223cb1fd392cadd0 to your computer and use it in GitHub Desktop.
JPG to PDF automation
#!/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