| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
package PDF::Imposition::Schema1repeat2top; |
|
2
|
3
|
|
|
3
|
|
2294
|
use strict; |
|
|
3
|
|
|
|
|
8
|
|
|
|
3
|
|
|
|
|
151
|
|
|
3
|
3
|
|
|
3
|
|
20
|
use warnings; |
|
|
3
|
|
|
|
|
7
|
|
|
|
3
|
|
|
|
|
100
|
|
|
4
|
3
|
|
|
3
|
|
18
|
use Moo; |
|
|
3
|
|
|
|
|
7
|
|
|
|
3
|
|
|
|
|
32
|
|
|
5
|
|
|
|
|
|
|
with "PDF::Imposition::Schema"; |
|
6
|
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
=head1 NAME |
|
8
|
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
PDF::Imposition::Schema1repeat2top - put two identical pages one on the top of each other. |
|
10
|
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
=head1 SYNOPSIS |
|
12
|
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
use PDF::Imposition::Schema1repeat2top; |
|
14
|
|
|
|
|
|
|
my $imposer = PDF::Imposition::Schema1repeat2top->new( |
|
15
|
|
|
|
|
|
|
file => "test.pdf", |
|
16
|
|
|
|
|
|
|
output => "out.pdf", |
|
17
|
|
|
|
|
|
|
); |
|
18
|
|
|
|
|
|
|
$imposer->impose; |
|
19
|
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
=head1 SCHEMA EXPLANATION |
|
21
|
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
+-----+ +-----+ |
|
23
|
|
|
|
|
|
|
| | | | |
|
24
|
|
|
|
|
|
|
| 1 | | 2 | |
|
25
|
|
|
|
|
|
|
| | | | |
|
26
|
|
|
|
|
|
|
+-----+ +-----+ |
|
27
|
|
|
|
|
|
|
| | | | |
|
28
|
|
|
|
|
|
|
| 1 | | 2 | |
|
29
|
|
|
|
|
|
|
| | | | |
|
30
|
|
|
|
|
|
|
+-----+ +-----+ |
|
31
|
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
The same logical page is inserted twice, one on the top of each other, |
|
33
|
|
|
|
|
|
|
on the same sheet, nothing else. |
|
34
|
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
=cut |
|
36
|
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
sub _do_impose { |
|
39
|
2
|
|
|
2
|
|
9
|
my $self = shift; |
|
40
|
2
|
|
|
|
|
42
|
$self->out_pdf_obj->mediabox( |
|
41
|
|
|
|
|
|
|
$self->orig_width, |
|
42
|
|
|
|
|
|
|
$self->orig_height * 2, |
|
43
|
|
|
|
|
|
|
); |
|
44
|
2
|
|
|
|
|
429
|
foreach my $pageno (1..$self->total_pages) { |
|
45
|
6
|
|
|
|
|
1666
|
my ($page, $gfx, $chunk); |
|
46
|
6
|
|
|
|
|
159
|
$page = $self->out_pdf_obj->page; |
|
47
|
6
|
|
|
|
|
5234
|
$gfx = $page->gfx; |
|
48
|
6
|
|
|
|
|
1391
|
$chunk = $self->get_imported_page($pageno); |
|
49
|
6
|
50
|
|
|
|
784132
|
$gfx->formimage($chunk, 0, 0) if $chunk; |
|
50
|
6
|
|
|
|
|
2760
|
$chunk = $self->get_imported_page($pageno); |
|
51
|
6
|
50
|
|
|
|
9222
|
$gfx->formimage($chunk, 0, $self->orig_height) if $chunk; |
|
52
|
|
|
|
|
|
|
} |
|
53
|
|
|
|
|
|
|
} |
|
54
|
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
=head1 INTERNALS |
|
56
|
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
=head2 cropmarks_options |
|
58
|
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
Set twoside to false. |
|
60
|
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
=cut |
|
62
|
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
sub cropmarks_options { |
|
64
|
1
|
|
|
1
|
1
|
11
|
my %options = ( |
|
65
|
|
|
|
|
|
|
top => 1, |
|
66
|
|
|
|
|
|
|
bottom => 1, |
|
67
|
|
|
|
|
|
|
inner => 1, |
|
68
|
|
|
|
|
|
|
outer => 1, |
|
69
|
|
|
|
|
|
|
# no shifting need |
|
70
|
|
|
|
|
|
|
twoside => 0, |
|
71
|
|
|
|
|
|
|
signature => 0, |
|
72
|
|
|
|
|
|
|
); |
|
73
|
1
|
|
|
|
|
16
|
return %options; |
|
74
|
|
|
|
|
|
|
} |
|
75
|
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
1; |