my ($card_svg,$nr,$login,$ime,$prezime) = @ARGV;
+my $png = $ENV{PNG} || 0;
+
warn "# svg: $card_svg nr: $nr $ime $prezime\n";
my $mapping = {
$part =~ s/print-//; # FIXME change svg files
print $inkscape "$shell --export-pdf $out.$part.pdf\n";
- print $inkscape "$shell --export-png $out.$part.png --export-dpi 150\n";
+ print $inkscape "$shell --export-png $out.$part.png --export-dpi 150\n" if $png;
}
inkscape_export 'print-front';
inkscape_export 'print-back';
# export visible
-print $inkscape "$out.svg --export-png $out.png --export-dpi 300\n";
+print $inkscape "$out.svg --export-png $out.png --export-dpi 300\n" if $png;
close($inkscape);
my $pbm = $pdf;
$pbm =~ s/pdf$/pbm/;
warn "# rendering $pdf => $pbm using ghostscript\n";
- system "gs -dNOPAUSE -dBATCH -q -r300x300 -dDEVICEWIDTHPOINTS=243 -dDEVICEHEIGHTPOINTS=155 -sDEVICE=pbmraw -sOutputFile=$pbm -f $pdf";
+ system "gs -dNOPAUSE -dBATCH -q -r300x300 -dDEVICEWIDTHPOINTS=243 -dDEVICEHEIGHTPOINTS=155 -dPDFFitPage -sDEVICE=pbmraw -sOutputFile=$pbm -f $pdf";
}
-system "pdftk $out.front.pdf $out.back.pdf cat output $out.duplex.pdf";
+system "pdftk $out.front.pdf $out.back.pdf cat output $out.duplex.pdf" if $ENV{DUPLEX};
__END__