line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package PDF::Imposition::Schema1repeat2top; |
2
|
3
|
|
|
3
|
|
1734
|
use strict; |
|
3
|
|
|
|
|
6
|
|
|
3
|
|
|
|
|
84
|
|
3
|
3
|
|
|
3
|
|
10
|
use warnings; |
|
3
|
|
|
|
|
4
|
|
|
3
|
|
|
|
|
73
|
|
4
|
3
|
|
|
3
|
|
11
|
use Moo; |
|
3
|
|
|
|
|
3
|
|
|
3
|
|
|
|
|
22
|
|
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
|
|
4
|
my $self = shift; |
40
|
2
|
|
|
|
|
31
|
$self->out_pdf_obj->mediabox( |
41
|
|
|
|
|
|
|
$self->orig_width, |
42
|
|
|
|
|
|
|
$self->orig_height * 2, |
43
|
|
|
|
|
|
|
); |
44
|
2
|
|
|
|
|
261
|
foreach my $pageno (1..$self->total_pages) { |
45
|
6
|
|
|
|
|
822
|
my ($page, $gfx, $chunk); |
46
|
6
|
|
|
|
|
102
|
$page = $self->out_pdf_obj->page; |
47
|
6
|
|
|
|
|
1694
|
$gfx = $page->gfx; |
48
|
6
|
|
|
|
|
659
|
$chunk = $self->get_imported_page($pageno); |
49
|
6
|
50
|
|
|
|
500780
|
$gfx->formimage($chunk, 0, 0) if $chunk; |
50
|
6
|
|
|
|
|
1428
|
$chunk = $self->get_imported_page($pageno); |
51
|
6
|
50
|
|
|
|
5119
|
$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
|
9
|
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
|
|
|
|
|
17
|
return %options; |
74
|
|
|
|
|
|
|
} |
75
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
1; |