libart-paperback 0.1.0-a.1.20260122225059.e5fea306241a
PDF (1.4) library for C++
page.hxx
1#ifndef art__paperback__page_hxx_
2#define art__paperback__page_hxx_
3
4#include <art/paperback/types.hxx>
5#include <art/paperback/forward.hxx>
6#include <art/paperback/primitives.hxx>
7
8namespace Art::Paperback
9{
10
11 class Page
12 {
13 public:
14 struct Create_new {};
15 static constexpr Create_new const create_new{};
16
17 /// Properties of a new page.
18 ///
20 {
21 /// Specifies the page's media box (required).
22 ///
24
25 /// Specifies the page's crop box.
26 ///
27 optional<Rectangle> crop_box;
28
29 /// Specifies the page's bleed box.
30 ///
31 optional<Rectangle> bleed_box;
32
33 /// Specifies the page's trim box.
34 ///
35 optional<Rectangle> trim_box;
36
37 /// Specifies the page's art box.
38 ///
39 optional<Rectangle> art_box;
40
41 };
42
43 /// Constructor.
44 ///
45 Page(Create_new const&,
47 Properties const&);
48
49 /// Destructor.
50 ///
51 ~Page() noexcept;
52
53 /// Access the parent page tree.
54 ///
55 Internals::Page_tree&
56 page_tree() const;
57
58 /// Access the page's object.
59 ///
60 Carousel::Object
61 object() const;
62
63 /// Access the page content stream.
64 ///
65 Carousel::Stream&
66 contents();
67
68 /// Access page resource collection.
69 ///
70 Internals::Resource_collection&
71 resources();
72
73 private:
74 Page(Page const&) = delete;
75 Page(Page&&) = delete;
76 Page& operator=(Page const&) = delete;
77 Page& operator=(Page&&) = delete;
78
79 private:
80 struct Internal;
81 unique_ptr<Internal> internal;
82
83 };
84
85 /// Get the document associated with a page.
86 ///
88 document(Page&);
89
90 /// Get the document associated with a page.
91 ///
92 Document const&
93 document(Page const&);
94
95} // namespace Art::Paperback
96
97#endif
Definition document.hxx:12
Represents a PDF page tree.
Definition page-tree.hxx:16
Internals::Resource_collection & resources()
Access page resource collection.
Definition page.cxx:111
~Page() noexcept
Destructor.
Definition page.cxx:75
Page(Create_new const &, Internals::Page_tree &, Properties const &)
Constructor.
Definition page.cxx:57
Carousel::Stream & contents()
Access the page content stream.
Definition page.cxx:94
Internals::Page_tree & page_tree() const
Access the parent page tree.
Definition page.cxx:80
Represents a PDF rectangle.
Definition primitives.hxx:27
COS file format implementation namespace.
Definition array.cxx:6
Internal namespace.
Definition forward.hxx:91
Primary paperback namespace.
Definition array.cxx:6
Document & document(Page &page)
Get the document associated with a page.
Definition page.cxx:120
Definition page.hxx:14
Definition page.cxx:20
Properties of a new page.
Definition page.hxx:20
optional< Rectangle > trim_box
Specifies the page's trim box.
Definition page.hxx:35
optional< Rectangle > bleed_box
Specifies the page's bleed box.
Definition page.hxx:31
optional< Rectangle > art_box
Specifies the page's art box.
Definition page.hxx:39
Rectangle media_box
Specifies the page's media box (required).
Definition page.hxx:23
optional< Rectangle > crop_box
Specifies the page's crop box.
Definition page.hxx:27