1PDF::API2::Page(3) User Contributed Perl Documentation PDF::API2::Page(3)
2
3
4
6 PDF::API2::Page - Methods to interact with individual pages
7
9 $page = PDF::API2::Page->new $pdf, $parent, $index
10 Returns a page object (called from $pdf->page).
11
12 $page = PDF::API2::Page->coerce $pdf, $pdfpage
13 Returns a page object converted from $pdfpage (called from
14 $pdf->openpage).
15
16 $page->update
17 Marks a page to be updated (by $pdf->update).
18
19 ($llx, $lly, $urx, $ury) = $page->mediabox()
20 $page->mediabox($w, $h)
21 $page->mediabox($llx, $lly, $urx, $ury)
22 $page->mediabox($alias)
23 Get or set the mediabox. This method supports the following
24 aliases: '4A0', '2A0', 'A0', 'A1', 'A2', 'A3', 'A4', 'A5', 'A6',
25 '4B0', '2B0', 'B0', 'B1', 'B2', 'B3', 'B4', 'B5', 'B6', 'LETTER',
26 'BROADSHEET', 'LEDGER', 'TABLOID', 'LEGAL', 'EXECUTIVE', and
27 '36X36'.
28
29 ($llx, $lly, $urx, $ury) = $page->cropbox()
30 $page->cropbox($w, $h)
31 $page->cropbox($llx, $lly, $urx, $ury)
32 $page->cropbox($alias)
33 Get or set the cropbox. This method supports the same aliases as
34 mediabox.
35
36 The cropbox defaults to the mediabox.
37
38 ($llx, $lly, $urx, $ury) = $page->bleedbox()
39 $page->bleedbox($w, $h)
40 $page->bleedbox($llx, $lly, $urx, $ury)
41 $page->bleedbox($alias)
42 Get or set the bleedbox. This method supports the same aliases as
43 mediabox.
44
45 The bleedbox defaults to the cropbox.
46
47 ($llx, $lly, $urx, $ury) = $page->trimbox()
48 $page->trimbox($w, $h)
49 $page->trimbox($llx, $lly, $urx, $ury)
50 Get or set the trimbox. This method supports the same aliases as
51 mediabox.
52
53 The trimbox defaults to the cropbox.
54
55 ($llx, $lly, $urx, $ury) = $page->artbox()
56 $page->artbox($w, $h)
57 $page->artbox($llx, $lly, $urx, $ury)
58 $page->artbox($alias)
59 Get or set the artbox. This method supports the same aliases as
60 mediabox.
61
62 The rtbox defaults to the cropbox.
63
64 $page->rotate $deg
65 Rotates the page by the given degrees, which must be a multiple of
66 90.
67
68 (This allows you to auto-rotate to landscape without changing the
69 mediabox!)
70
71 $gfx = $page->gfx $prepend
72 Returns a graphics content object. If $prepend is true the content
73 will be prepended to the page description.
74
75 $txt = $page->text $prepend
76 Returns a text content object. If $prepend is true the content will
77 be prepended to the page description.
78
79 $ant = $page->annotation
80 Returns a new annotation object.
81
82 $page->resource $type, $key, $obj
83 Adds a resource to the page-inheritance tree.
84
85 Example:
86
87 $co->resource('Font',$fontkey,$fontobj);
88 $co->resource('XObject',$imagekey,$imageobj);
89 $co->resource('Shading',$shadekey,$shadeobj);
90 $co->resource('ColorSpace',$spacekey,$speceobj);
91
92 Note: You only have to add the required resources, if they are NOT
93 handled by the *font*, *image*, *shade* or *space* methods.
94
95
96
97perl v5.32.0 2020-07-28 PDF::API2::Page(3)