/usr/share/perl5/auto/PDF/Reuse/prImage.al is in libpdf-reuse-perl 0.35-2.
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 | # NOTE: Derived from blib/lib/PDF/Reuse.pm.
# Changes made here will be lost when autosplit is run again.
# See AutoSplit.pm.
package PDF::Reuse;
#line 3317 "blib/lib/PDF/Reuse.pm (autosplit into blib/lib/auto/PDF/Reuse/prImage.al)"
####################
# Behandla en bild
####################
sub prImage
{ my $param = shift;
my ($infil, $sidnr, $bildnr, $effect, $adjust, $x, $y, $size, $xsize,
$ysize, $rotate);
if (ref($param) eq 'HASH')
{ $infil = $param->{'file'};
$sidnr = $param->{'page'} || 1;
$bildnr = $param->{'imageNo'} || 1;
$effect = $param->{'effect'} || 'print';
$adjust = $param->{'adjust'} || '';
$x = $param->{'x'} || 0;
$y = $param->{'y'} || 0;
$rotate = $param->{'rotate'} || 0;
$size = $param->{'size'} || 1;
$xsize = $param->{'xsize'} || 1;
$ysize = $param->{'ysize'} || 1;
}
else
{ $infil = $param;
$sidnr = shift || 1;
$bildnr = shift || 1;
$effect = shift || 'print';
$adjust = shift || '';
$x = shift || 0;
$y = shift || 0;
$rotate = shift || 0;
$size = shift || 1;
$xsize = shift || 1;
$ysize = shift || 1;
}
my ($refNr, $inamn, $bildIndex, $xc, $yc, $xs, $ys);
$type = 'image';
$bildIndex = $bildnr - 1;
my $fSource = $infil . '_' . $sidnr;
my $iSource = $fSource . '_' . $bildnr;
if (! exists $image{$iSource})
{ $imageNr++;
$inamn = 'Ig' . $imageNr;
$knownToFile{'Ig:' . $iSource} = $inamn;
$image{$iSource}[imXPOS] = 0;
$image{$iSource}[imYPOS] = 0;
$image{$iSource}[imXSCALE] = 1;
$image{$iSource}[imYSCALE] = 1;
if (! exists $form{$fSource} )
{ $refNr = getPage($infil, $sidnr, '');
if ($refNr)
{ $formNr++;
my $namn = 'Fm' . $formNr;
$knownToFile{$fSource} = $namn;
}
elsif ((defined $refNr) && ($refNr eq '0'))
{ errLog("File: $infil Page: $sidnr can't be found");
}
}
my $in = $form{$fSource}[fIMAGES][$bildIndex];
$image{$iSource}[imWIDTH] = $form{$fSource}->[fOBJ]->{$in}->[oWIDTH];
$image{$iSource}[imHEIGHT] = $form{$fSource}->[fOBJ]->{$in}->[oHEIGHT];
$image{$iSource}[imIMAGENO] = $form{$fSource}[fIMAGES][$bildIndex];
}
if (exists $knownToFile{'Ig:' . $iSource})
{ $inamn = $knownToFile{'Ig:' . $iSource};
}
else
{ $imageNr++;
$inamn = 'Ig' . $imageNr;
$knownToFile{'Ig:' . $iSource} = $inamn;
}
if (! exists $objRef{$inamn})
{ $refNr = getImage($infil, $sidnr,
$bildnr, $image{$iSource}[imIMAGENO]);
$objRef{$inamn} = $refNr;
}
else
{ $refNr = $objRef{$inamn};
}
my @iData = @{$image{$iSource}};
if (($effect eq 'print') && ($refNr))
{ if (! defined $defGState)
{ prDefaultGrState();}
$stream .= "\n/Gs0 gs\n";
$stream .= "q\n";
if ($adjust)
{ $stream .= fillTheForm(0, 0, $iData[imWIDTH], $iData[imHEIGHT],$adjust);
}
else
{ my $tX = ($x + $iData[imXPOS]);
my $tY = ($y + $iData[imYPOS]);
$stream .= calcMatrix($tX, $tY, $rotate, $size,
$xsize, $ysize, $iData[imWIDTH], $iData[imHEIGHT]);
}
$stream .= "$iData[imWIDTH] 0 0 $iData[imHEIGHT] 0 0 cm\n";
$stream .= "/$inamn Do\n";
$sidXObject{$inamn} = $refNr;
$stream .= "Q\n";
$sidExtGState{'Gs0'} = $defGState;
}
if ($runfil)
{ $infil = prep($infil);
$log .= "Image~$infil~$sidnr~$bildnr~$effect~$adjust";
$log .= "$x~$y~$size~$xsize~$ysize~$rotate\n";
}
if (! $pos)
{ errLog("No output file, you have to call prFile first");
}
if (wantarray)
{ return ($inamn, $iData[imWIDTH], $iData[imHEIGHT]);
}
else
{ return $inamn;
}
}
# end of PDF::Reuse::prImage
1;
|