diff options
author | Guilhem Moulin <guilhem.moulin@ens-lyon.org> | 2012-01-23 18:39:11 +0100 |
---|---|---|
committer | Guilhem Moulin <guilhem.moulin@ens-lyon.org> | 2012-01-23 18:39:11 +0100 |
commit | 91e1e8c1664ee11ece867346767befc13b09c57b (patch) | |
tree | 4e07740144a8d8785702b02e868ad97e3d630d23 | |
parent | 5b15f24acb1860e22a75d4aaf8ccdcf192d6f876 (diff) |
language level
-rwxr-xr-x | pdftool.pl | 21 |
1 files changed, 14 insertions, 7 deletions
@@ -193,8 +193,8 @@ outputs! =item B<--ps> -By default, B<PDFTool> outputs a PDF document; use this flag if -you want a PostScript instead. +By default, B<PDFTool> outputs a PDF 1.4 document; use this flag if +you want a PostScript (language level 2) instead. =item B<--column> @@ -313,7 +313,7 @@ while (@ARGV) { *LOG = *STDERR; -my @gs = ('gs', '-dSAFER'); +my @gs = ('gs', '-P-', '-dSAFER'); # Global variables my @auxfiles; # Auxiliary files, to remove @@ -576,10 +576,11 @@ sub pdftops { # Convert to PS # TODO: use gs & ps2write, more portable - my @cmd = ('pdftops', '-origpagesizes', $infile, '-'); + my @cmd = ('pdftops', '-passfonts', '-level3', '-origpagesizes'); push @cmd, '-f', $first if defined $first; push @cmd, '-l', $last if defined $last; push @cmd, '-q' if exists $config->{quiet}; + push @cmd, '--', $infile, '-'; my $pid = open $OUT, '-|', @cmd; push @pids, [$pid, @cmd]; @@ -917,9 +918,15 @@ sub write { $pagedevice = "/PageSize [$out{width} $out{height}]"; } - my $device = '-sDEVICE=pdfwrite'; - $device = '-sDEVICE=ps2write' if exists $out{ps}; - my @cmd = (@gs, '-dQUIET', '-dBATCH', '-dNOPAUSE', $device, + my @device; + if (exists $out{ps}) { + # TODO: Can't output a postcript level 3 + @device = ('-sDEVICE=ps2write', '-dLanguageLevel=3'); + } + else { + @device = ('-sDEVICE=pdfwrite', '-dCompatibilityLevel=1.4'); + } + my @cmd = (@gs, '-dQUIET', '-dBATCH', '-dNOPAUSE', @device, '-dAutoRotatePages=/None', '-dDetectDuplicateImages=false', # Preserve image quality |