| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
package PDF::Imposition::Schema1repeat4; |
|
2
|
3
|
|
|
3
|
|
1848
|
use strict; |
|
|
3
|
|
|
|
|
5
|
|
|
|
3
|
|
|
|
|
88
|
|
|
3
|
3
|
|
|
3
|
|
10
|
use warnings; |
|
|
3
|
|
|
|
|
5
|
|
|
|
3
|
|
|
|
|
72
|
|
|
4
|
3
|
|
|
3
|
|
10
|
use Moo; |
|
|
3
|
|
|
|
|
3
|
|
|
|
3
|
|
|
|
|
23
|
|
|
5
|
|
|
|
|
|
|
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
|
|
|
|
|
|
|
sub _do_impose { |
|
41
|
2
|
|
|
2
|
|
3
|
my $self = shift; |
|
42
|
2
|
|
|
|
|
32
|
$self->out_pdf_obj->mediabox( |
|
43
|
|
|
|
|
|
|
$self->orig_width * 2, |
|
44
|
|
|
|
|
|
|
$self->orig_height * 2, |
|
45
|
|
|
|
|
|
|
); |
|
46
|
2
|
|
|
|
|
263
|
foreach my $pageno (1..$self->total_pages) { |
|
47
|
6
|
|
|
|
|
834
|
my ($page, $gfx, $chunk); |
|
48
|
6
|
|
|
|
|
106
|
$page = $self->out_pdf_obj->page; |
|
49
|
6
|
|
|
|
|
1721
|
$gfx = $page->gfx; |
|
50
|
6
|
|
|
|
|
687
|
$chunk = $self->get_imported_page($pageno); |
|
51
|
6
|
50
|
|
|
|
499477
|
$gfx->formimage($chunk, 0, 0) if $chunk; |
|
52
|
6
|
|
|
|
|
1379
|
$chunk = $self->get_imported_page($pageno); |
|
53
|
6
|
50
|
|
|
|
5197
|
$gfx->formimage($chunk, $self->orig_width, 0) if $chunk; |
|
54
|
6
|
|
|
|
|
1262
|
$chunk = $self->get_imported_page($pageno); |
|
55
|
6
|
50
|
|
|
|
4885
|
$gfx->formimage($chunk, $self->orig_width, $self->orig_height) if $chunk; |
|
56
|
6
|
|
|
|
|
1210
|
$chunk = $self->get_imported_page($pageno); |
|
57
|
6
|
50
|
|
|
|
4718
|
$gfx->formimage($chunk, 0, $self->orig_height) if $chunk; |
|
58
|
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
} |
|
60
|
|
|
|
|
|
|
} |
|
61
|
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
=head1 INTERNALS |
|
63
|
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
=head2 cropmarks_options |
|
65
|
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
Set twoside to false. |
|
67
|
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
=cut |
|
69
|
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
sub cropmarks_options { |
|
71
|
1
|
|
|
1
|
1
|
8
|
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
|
|
|
|
|
15
|
return %options; |
|
81
|
|
|
|
|
|
|
} |
|
82
|
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
1; |