/usr/share/perl5/PDF/Util/reuseComponent_pl is in libpdf-reuse-perl 0.39-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 | use warnings;
use strict;
use PDF::Reuse;
my %stdFont =
( 'Times-Roman' => 'Times-Roman',
'Times-Bold' => 'Times-Bold',
'Times-Italic' => 'Times-Italic',
'Times-BoldItalic' => 'Times-BoldItalic',
'Courier' => 'Courier',
'Courier-Bold' => 'Courier-Bold',
'Courier-Oblique' => 'Courier-Oblique',
'Courier-BoldOblique' => 'Courier-BoldOblique',
'Helvetica' => 'Helvetica',
'Helvetica-Bold' => 'Helvetica-Bold',
'Helvetica-Oblique' => 'Helvetica-Oblique',
'Helvetica-BoldOblique' => 'Helvetica-BoldOblique',
'Symbol' => 'Symbol',
'ZapfDingbats' => 'ZapfDingbats',
'TR' => 'Times-Roman',
'TB' => 'Times-Bold',
'TI' => 'Times-Italic',
'TBI' => 'Times-BoldItalic',
'C' => 'Courier',
'CB' => 'Courier-Bold',
'CO' => 'Courier-Oblique',
'CBO' => 'Courier-BoldOblique',
'H' => 'Helvetica',
'HB' => 'Helvetica-Bold',
'HO' => 'Helvetica-Oblique',
'HBO' => 'Helvetica-BoldOblique',
'S' => 'Symbol',
'Z' => 'ZapfDingbats');
my ($line, $string);
my $x = 25;
my $y = 710;
my ($xDim, $yDim, $xScale, $yScale, $pdf);
my $file = shift;
my $i = 1;
prFile('myFile.pdf');
prFontSize(7);
while (1)
{ my @vec = prForm( { file => $file,
page => $i,
effect => 'add',
tolerant => 1 });
my $form = $vec[0];
if ($form eq '0')
{ last;
}
if ($form)
{ $xDim = $vec[3] - $vec[1];
$yDim = $vec[4] - $vec[2];
$xScale = 100 / $xDim;
$yScale = 100 / $yDim;
if ($xScale < $yScale)
{ $yScale = $xScale;
}
else
{ $xScale = $yScale;
}
$string = "q\n";
$string .= "$xScale 0 0 $yScale $x $y cm\n"; # scale and "move to"
$string .= "/$form Do\n";
$string .= "Q\n";
prAdd($string);
}
else
{ prText($x, ($y + 70), 'Can\'t be used by prForm.');
prText($x, ($y + 60), 'Concatenate the streams.');
prText($x, ($y + 50), 'Look at the documentation');
prText($x, ($y + 40), 'for "prForm" how that can');
prText($x, ($y + 30), 'be done ! Or use prDoc or');
prText($x, ($y + 20), 'prSinglePage');
$xDim = 0;
$yDim = 0;
}
$line = 'Form : ' . $file . ' ' . $i . ' D: ' . $xDim . ' X ' . $yDim;
prText($x, ($y - 15), $line);
move();
my $j = 0;
my $images = $vec[5];
while ($j < $images)
{ $j++;
my ($iName, $width, $height) = prImage({ file => $file,
page => $i,
imageNo => $j,
effect => 'add' } );
if (($width < 101) && ($height < 101))
{ $xDim = $width;
$yDim = $height;
}
else
{
$xScale = 100 / $width;
$yScale = 100 / $height;
if ($xScale < $yScale)
{ $yScale = $xScale;
}
else
{ $xScale = $yScale;
}
$xDim = $xScale * $width;
$yDim = $yScale * $height;
}
$string = "q\n";
$string .= "$xDim 0 0 $yDim $x $y cm\n"; # scale and "move to"
$string .= "/$iName Do\n";
$string .= "Q\n";
prAdd($string);
$line = 'Image :' . $file . ' ' . $i . ' ' . $j . ' D: '
. $width . ' X ' . $height;
prText($x, ($y - 15), $line);
move();
}
$i++;
}
$x = 25;
$y -= 40;
if ($y < 100)
{ prPage();
$y = 710;
}
prFontSize(20);
prFont('TR');
prText($x, $y, 'Found "non-standard" fonts: ');
$y -= 40;
my ($intnamn, $extnamn, $oldIntNamn, $oldExtNamn, $f) = prFont();
my %font;
for my $font (keys %{$f})
{ if (exists $font{$font})
{ next;
}
if ($y < 100)
{ prPage();
$y = 710;
}
if (! exists $stdFont{$font})
{ my @list = prFont($font);
if ($list[1] eq $font)
{ prFontSize(18);
prFont('TR');
prText($x, $y, "$font :");
$y -= 25;
prFontSize(10);
prFont($font);
prText($x, $y, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ!"#$%&\'()*+-./0123456789:;<=>?@');
$y -= 14;
prText($x, $y, 'abcdefghijklmnopqrstuvwxyz{|}~\305\304\326\345\344\366[\]^_ยด`');
$y -= 40;
}
}
# $font{$font}++;
}
prEnd();
sub move
{ if ($x > 400)
{ $x = 25;
$y -= 120;
}
else
{ $x += 200;
}
if ($y < 0)
{ prPage();
$x = 25;
$y = 710;
}
}
__END__
=head1 AUTHOR
Lars Lundberg larslund@cpan.org
Chris Nighswonger cnighs@cpan.org
=head1 COPYRIGHT
Copyright (C) 2003 - 2004 Lars Lundberg, Solidez HB.
Copyright (C) 2005 Karin Lundberg.
Copyright (C) 2006 - 2010 Lars Lundberg, Solidez HB.
Copyright (C) 2010 - 2014 Chris Nighswonger
=head1 LICENSE
This program is free software; you can redistribute it and/or
modify it under the same terms as Perl itself.
|