1 | <?php |
||
15 | class PageWriter |
||
16 | { |
||
17 | /** |
||
18 | * @var ObjectWriter |
||
19 | */ |
||
20 | private $objectWriter; |
||
21 | |||
22 | /** |
||
23 | * @var int |
||
24 | */ |
||
25 | private $pageId; |
||
26 | |||
27 | /** |
||
28 | * @var Rectangle[] |
||
29 | */ |
||
30 | private $boxes = []; |
||
31 | |||
32 | /** |
||
33 | * @var int|null |
||
34 | */ |
||
35 | private $rotation; |
||
36 | |||
37 | /** |
||
38 | * @var string |
||
39 | */ |
||
40 | private $contentStream = ''; |
||
41 | |||
42 | /** |
||
43 | * @param ObjectWriter $objectWriter |
||
44 | */ |
||
45 | public function __construct(ObjectWriter $objectWriter) |
||
50 | |||
51 | /** |
||
52 | * Sets a box for the page. |
||
53 | * |
||
54 | * @param string $name |
||
55 | * @param Rectangle $box |
||
56 | */ |
||
57 | public function setBox($name, Rectangle $box) |
||
61 | |||
62 | /** |
||
63 | * Sets the rotation of the page. |
||
64 | * |
||
65 | * @param int $degrees |
||
66 | * @throws DomainException |
||
67 | */ |
||
68 | public function setRotation($degrees) |
||
76 | |||
77 | /** |
||
78 | * Appends data to the content stream. |
||
79 | * |
||
80 | * @param string $data |
||
81 | */ |
||
82 | public function appendContentStream($data) |
||
86 | |||
87 | /** |
||
88 | * Writes the page contents and definition to the writer. |
||
89 | * |
||
90 | * @param ObjectWriter $objectWriter |
||
91 | * @param int $pageTreeId |
||
92 | * @return int |
||
93 | */ |
||
94 | public function writePage(ObjectWriter $objectWriter, $pageTreeId) |
||
126 | } |
||
127 |