| 1 | package PDF::Imposition::Schema1repeat2top; | ||||||||||
| 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::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 | 2 | ▶ | sub _do_impose { | ||||||||
|
Subroutine
_do_impose: called CC=4 SCAR=14.0
| |||||||||||
| 39 | 2 | my $self = shift; | |||||||||
| 40 | 2 | $self->out_pdf_obj->mediabox( | |||||||||
| 41 | $self->orig_width, | ||||||||||
| 42 | $self->orig_height * 2, | ||||||||||
| 43 | ); | ||||||||||
| 44 | 2 | foreach my $pageno (1..$self->total_pages) { | |||||||||
| 45 | 6 | my ($page, $gfx, $chunk); | |||||||||
| 46 | 6 | $page = $self->out_pdf_obj->page; | |||||||||
| 47 | 6 | $gfx = $page->gfx; | |||||||||
| 48 | 6 | $chunk = $self->get_imported_page($pageno); | |||||||||
| 49 | 6 | ▶ | $gfx->formimage($chunk, 0, 0) if $chunk; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 50 | 6 | $chunk = $self->get_imported_page($pageno); | |||||||||
| 51 | 6 | ▶ | $gfx->formimage($chunk, 0, $self->orig_height) if $chunk; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 52 | } | ||||||||||
| 53 | } | ||||||||||
| 54 | |||||||||||
| 55 | =head1 INTERNALS | ||||||||||
| 56 | |||||||||||
| 57 | =head2 cropmarks_options | ||||||||||
| 58 | |||||||||||
| 59 | Set twoside to false. | ||||||||||
| 60 | |||||||||||
| 61 | =cut | ||||||||||
| 62 | |||||||||||
| 63 | 1 | ▶ | sub cropmarks_options { | ||||||||
|
Subroutine
cropmarks_options: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||
| 64 | 1 | 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 | return %options; | |||||||||
| 74 | } | ||||||||||
| 75 | |||||||||||
| 76 | |||||||||||
| 77 | 3 | 1; | |||||||||