lib/PDF/Imposition/Schema1repeat2side.pm

filter: Statementstmt 100% 23 / 23 Branchbran 50.0% 2 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 5 / 5 Podpod 100% 1 / 1 totaltotal 93.9% 31 / 33 CC 4 SCAR 9.3
CC
4
Cov
93%
_do_impose
4.0
BEGIN
1.0
BEGIN
1.0
CRAP 2.5
« lib/PDF/Imposition/Schema2x4x2.pm ↑ Summary lib/PDF/Imposition/Schema1repeat2top.pm »
1 package PDF::Imposition::Schema1repeat2side;
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::Schema1repeat2side - put two identical pages side by side on the same physical sheet
10  
11 =head1 SYNOPSIS
12  
13 use PDF::Imposition::Schema1repeat2side;
14 my $imposer = PDF::Imposition::Schema1repeat2side->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 The same logical page is inserted twice, side by side, on the same
29 sheet, nothing else. Typical usage scenario: printing A5 leaflets on
30 A4, then cut the sheets vertically.
31  
32 =cut
33  
34  
35 2 ▶sub _do_impose {
Subroutine _do_impose: called CC=4 SCAR=14.0
36 2 my $self = shift;
37 2 $self->out_pdf_obj->mediabox(
38 $self->orig_width * 2,
39 $self->orig_height,
40 );
41 2 foreach my $pageno (1..$self->total_pages) {
42 6 my ($page, $gfx, $chunk);
43 6 $page = $self->out_pdf_obj->page;
44 6 $gfx = $page->gfx;
45 6 $chunk = $self->get_imported_page($pageno);
46 6 ▶ $gfx->formimage($chunk, 0, 0) if $chunk;
Branch: 1 branch
BranchTrueFalseTotal
if $chunk 6 0 6
47 6 $chunk = $self->get_imported_page($pageno);
48 6 ▶ $gfx->formimage($chunk, $self->orig_width, 0) if $chunk;
Branch: 1 branch
BranchTrueFalseTotal
if $chunk 6 0 6
49 }
50 }
51  
52 =head1 INTERNALS
53  
54 =head2 cropmarks_options
55  
56 Set twoside to false.
57  
58 =cut
59  
60 1 ▶sub cropmarks_options {
Subroutine cropmarks_options: called CC=1 SCAR=0.0
Pod documented
61 1 my %options = (
62 top => 1,
63 bottom => 1,
64 inner => 1,
65 outer => 1,
66 # no shifting need
67 twoside => 0,
68 signature => 0,
69 );
70 1 return %options;
71 }
72  
73 3 1;
« lib/PDF/Imposition/Schema2x4x2.pm ↑ Summary lib/PDF/Imposition/Schema1repeat2top.pm »