AutoTeX/ConcatPDF.pm

filter: Statementstmt 56.2% 18 / 32 Branchbran 0.0% 0 / 2 Conditioncond 0.0% 0 / 4 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 83.3% 5 / 6 Podpod 100% 1 / 1 totaltotal 51.0% 24 / 47 CC 5 SCAR 27.4
CC
5
Cov
47%
concatenate_pdf
30.0
BEGIN
1.0
BEGIN
1.0
CRAP 15.5
« AutoTeX/Mail.pm ↑ Summary AutoTeX/Log.pm »
1 package TeX::AutoTeX::ConcatPDF;
2 #
3 # $Id: ConcatPDF.pm,v 1.2.2.7 2011/01/27 18:56:29 thorstens Exp $
4 # $Revision: 1.2.2.7 $
5 # $Source: /cvsroot/arxivlib/arXivLib/lib/TeX/AutoTeX/ConcatPDF.pm,v $
6 #
7 # $Date: 2011/01/27 18:56:29 $
8 # $Author: thorstens $
9 #
10 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
11 ### use warnings;
12  
13 1 ▶use version; our $VERSION = qv('0.94');
Subroutine BEGIN: called CC=1 SCAR=0.0
14 1 ▶use parent qw(Exporter);
Subroutine BEGIN: called CC=1 SCAR=0.0
15 1 our @EXPORT_OK = qw(concatenate_pdf);
16  
17 1 ▶use CAM::PDF;
Subroutine BEGIN: called CC=1 SCAR=0.0
18 1 ▶use Carp qw(croak carp);
Subroutine BEGIN: called CC=1 SCAR=0.0
19  
20 0 ▶sub concatenate_pdf {
Subroutine concatenate_pdf: not called CC=5 SCAR=34.0
Pod documented
21 0 my ($combinedfile, $listref) = @_;
22  
23 0 ▶ return if @{$listref} < 2;
Branch: 1 branch
BranchTrueFalseTotal
if @{$listref;} < 2 0 0 0
24  
25 0 ▶ my $combineddoc = CAM::PDF->new(shift @{$listref}) ||
Condition0%0/2
'CAM::PDF'->new(shift @{$listref;}) || croak($CAM::PDF::errstr)
l!l
00
MC/DC0%0/1
'CAM::PDF'->new(shift @{$listref;}) || croak($CAM::PDF::errstr)
'CAM::PDF'->new(shift @{$listref;})
Truth table0%0/2
A
A= 'CAM::PDF'->new(shift @{$listref;})
Aresult
11
00
26 croak $CAM::PDF::errstr;
27  
28 0 foreach my $file (@{$listref}) {
29 0 ▶ my $doc = CAM::PDF->new($file) || croak $CAM::PDF::errstr;
Condition0%0/2
'CAM::PDF'->new($file) || croak($CAM::PDF::errstr)
l!l
00
MC/DC0%0/1
'CAM::PDF'->new($file) || croak($CAM::PDF::errstr)
'CAM::PDF'->new($file)
Truth table0%0/2
A
A= 'CAM::PDF'->new($file)
Aresult
11
00
30 0 carp 'Appending ', $doc->numPages(),
31 ' page(s) to original ',$combineddoc->numPages(), ' page(s)';
32 0 $combineddoc->appendPDF($doc);
33 }
34 0 $combineddoc->preserveOrder();
35 0 $combineddoc->clearAnnotations();
36 0 $combineddoc->cleanoutput($combinedfile);
37 0 return;
38 }
39  
40 1 1;
41  
42 __END__
« AutoTeX/Mail.pm ↑ Summary AutoTeX/Log.pm »