lib/PDF/Imposition/Schema1repeat4.pm

filter: Statementstmt 100% 27 / 27 Branchbran 50.0% 4 / 8 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 5 / 5 Podpod 100% 1 / 1 totaltotal 90.2% 37 / 41 CC 6 SCAR 14.2
CC
6
Cov
89%
_do_impose
6.2
BEGIN
1.0
BEGIN
1.0
CRAP 4.1
« lib/PDF/Imposition/Schema1x1.pm ↑ Summary lib/PDF/Imposition/Schemaduplex2up.pm »
1 package PDF::Imposition::Schema1repeat4;
2 3 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 3 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 3 ▶use Moo;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 3 with "PDF::Imposition::Schema";
6  
7 =head1 NAME
8  
9 PDF::Imposition::Schema1repeat4 - put four identical pages on the same physical sheet
10  
11 =head1 SYNOPSIS
12  
13 use PDF::Imposition::Schema1repeat4;
14 my $imposer = PDF::Imposition::Schema1repeat4->new(
15 file => "test.pdf",
16 output => "out.pdf",
17 );
18 $imposer->impose;
19  
20 =head1 SCHEMA EXPLANATION
21  
22 +-----+-----+ +-----+-----+
23 | | | | | |
24 | 1 | 1 | | 2 | 2 |
25 | | | | | |
26 +-----+-----+ +-----+-----+
27 | | | | | |
28 | 1 | 1 | | 2 | 2 |
29 | | | | | |
30 +-----+-----+ +-----+-----+
31  
32  
33 The same logical page is inserted four time, on the same sheet,
34 nothing else. Typical usage scenario: printing A6 leaflets on A4, then
35 cut the sheets vertically and horizontally.
36  
37 =cut
38  
39  
40 2 ▶sub _do_impose {
Subroutine _do_impose: called CC=6 SCAR=18.3
41 2 my $self = shift;
42 2 $self->out_pdf_obj->mediabox(
43 $self->orig_width * 2,
44 $self->orig_height * 2,
45 );
46 2 foreach my $pageno (1..$self->total_pages) {
47 6 my ($page, $gfx, $chunk);
48 6 $page = $self->out_pdf_obj->page;
49 6 $gfx = $page->gfx;
50 6 $chunk = $self->get_imported_page($pageno);
51 6 ▶ $gfx->formimage($chunk, 0, 0) if $chunk;
Branch: 1 branch
BranchTrueFalseTotal
if $chunk 6 0 6
52 6 $chunk = $self->get_imported_page($pageno);
53 6 ▶ $gfx->formimage($chunk, $self->orig_width, 0) if $chunk;
Branch: 1 branch
BranchTrueFalseTotal
if $chunk 6 0 6
54 6 $chunk = $self->get_imported_page($pageno);
55 6 ▶ $gfx->formimage($chunk, $self->orig_width, $self->orig_height) if $chunk;
Branch: 1 branch
BranchTrueFalseTotal
if $chunk 6 0 6
56 6 $chunk = $self->get_imported_page($pageno);
57 6 ▶ $gfx->formimage($chunk, 0, $self->orig_height) if $chunk;
Branch: 1 branch
BranchTrueFalseTotal
if $chunk 6 0 6
58  
59 }
60 }
61  
62 =head1 INTERNALS
63  
64 =head2 cropmarks_options
65  
66 Set twoside to false.
67  
68 =cut
69  
70 1 ▶sub cropmarks_options {
Subroutine cropmarks_options: called CC=1 SCAR=0.0
Pod documented
71 1 my %options = (
72 top => 1,
73 bottom => 1,
74 inner => 1,
75 outer => 1,
76 # no shifting need
77 twoside => 0,
78 signature => 0,
79 );
80 1 return %options;
81 }
82  
83  
84 3 1;
« lib/PDF/Imposition/Schema1x1.pm ↑ Summary lib/PDF/Imposition/Schemaduplex2up.pm »