Permalink
Browse files

[tutorial/make-pdf] number-of-pages no longer hardcoded

  • Loading branch information...
1 parent c0ad07f commit 8e3fe49cc6dbf1370e2562e095c0bc9ecd7f497b @masak committed Nov 6, 2009
Showing with 9 additions and 5 deletions.
  1. +9 −5 tutorial/make-pdf
View
@@ -6,11 +6,15 @@ my $inkscape_executable
die 'Could not find inkscape'
unless $inkscape_executable ~~ :f;
-run
- "$inkscape_executable "
- ~ "--without-gui --file=src/page$_.svg "
- ~ "--export-pdf=pdf/page$_.pdf 2> /dev/null"
- for 1..5;
+run 'rm -rf pdf/*';
+
+my $i = 0;
+while 'src/' ~ (my $page = 'page' ~ ++$i) ~ '.svg' ~~ :f {
+ run
+ "$inkscape_executable "
+ ~ "--without-gui --file=src/$page.svg "
+ ~ "--export-pdf=pdf/$page.pdf 2> /dev/null";
+}
run
'gs -q -sPAPERSIZE=letter -dNOPAUSE -dBATCH -sDEVICE=pdfwrite'

0 comments on commit 8e3fe49

Please sign in to comment.