rrtf 0.1.2 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.byebug_history +6 -3
- data/CHANGELOG.md +24 -0
- data/README.md +194 -84
- data/documentation/RRTF.html +5 -5
- data/documentation/RRTF/AnonymousStyle.html +792 -0
- data/documentation/RRTF/BorderFormatting.html +821 -0
- data/documentation/RRTF/BorderStyle.html +493 -0
- data/documentation/RRTF/CharacterFormatting.html +293 -162
- data/documentation/RRTF/CharacterStyle.html +53 -109
- data/documentation/RRTF/Colour.html +61 -1
- data/documentation/RRTF/ColourTable.html +52 -52
- data/documentation/RRTF/CommandNode.html +367 -971
- data/documentation/RRTF/ContainerNode.html +44 -44
- data/documentation/RRTF/Converters.html +1 -1
- data/documentation/RRTF/Converters/HTML.html +1 -1
- data/documentation/RRTF/Converters/HTML/Helpers.html +1 -1
- data/documentation/RRTF/Converters/HTML/Node.html +1 -1
- data/documentation/RRTF/Converters/HTML/NodeSet.html +1 -1
- data/documentation/RRTF/Document.html +267 -255
- data/documentation/RRTF/DocumentFormatting.html +833 -0
- data/documentation/RRTF/DocumentProperties.html +444 -0
- data/documentation/RRTF/Font.html +1 -1
- data/documentation/RRTF/FontTable.html +1 -1
- data/documentation/RRTF/FooterNode.html +16 -16
- data/documentation/RRTF/GeometryNode.html +774 -0
- data/documentation/RRTF/GeometryProperties.html +1014 -0
- data/documentation/RRTF/HeaderNode.html +16 -16
- data/documentation/RRTF/ImageNode.html +705 -492
- data/documentation/RRTF/Information.html +1 -1
- data/documentation/RRTF/LinkNode.html +10 -10
- data/documentation/RRTF/ListLevel.html +1 -1
- data/documentation/RRTF/ListLevelNode.html +37 -37
- data/documentation/RRTF/ListMarker.html +1 -1
- data/documentation/RRTF/ListNode.html +19 -19
- data/documentation/RRTF/ListTable.html +1 -1
- data/documentation/RRTF/ListTemplate.html +1 -1
- data/documentation/RRTF/ListTextNode.html +14 -14
- data/documentation/RRTF/Node.html +26 -26
- data/documentation/RRTF/Page.html +129 -0
- data/documentation/RRTF/Page/Margin.html +1158 -0
- data/documentation/RRTF/Page/Size.html +946 -0
- data/documentation/RRTF/PageFormatting.html +954 -0
- data/documentation/RRTF/ParagraphFormatting.html +338 -56
- data/documentation/RRTF/ParagraphNode.html +10 -10
- data/documentation/RRTF/ParagraphStyle.html +72 -111
- data/documentation/RRTF/PositionFormatting.html +780 -0
- data/documentation/RRTF/PositionStyle.html +424 -0
- data/documentation/RRTF/Properties.html +243 -0
- data/documentation/RRTF/RTFError.html +21 -10
- data/documentation/RRTF/ShadingFormatting.html +712 -0
- data/documentation/RRTF/ShadingStyle.html +424 -0
- data/documentation/RRTF/Style.html +284 -697
- data/documentation/RRTF/Stylesheet.html +36 -3
- data/documentation/RRTF/TableCellNode.html +131 -131
- data/documentation/RRTF/TableNode.html +82 -82
- data/documentation/RRTF/TableRowNode.html +53 -53
- data/documentation/RRTF/TextNode.html +46 -46
- data/documentation/RRTF/Utilities.html +837 -17
- data/documentation/_index.html +139 -6
- data/documentation/class_list.html +1 -1
- data/documentation/file.README.html +218 -87
- data/documentation/index.html +218 -87
- data/documentation/method_list.html +631 -391
- data/documentation/top-level-namespace.html +1 -1
- data/examples/01.rtf +947 -20
- data/examples/01_everything.rb +176 -0
- data/examples/02.rtf +13 -0
- data/examples/02_basic_paragraph.rb +10 -0
- data/examples/03.rtf +20 -0
- data/examples/03_paragraph_inline_style.rb +14 -0
- data/examples/04.rtf +21 -0
- data/examples/04_paragraph_with_character_style.rb +18 -0
- data/examples/05.rtf +21 -0
- data/examples/05_hyperlinks.rb +21 -0
- data/examples/06.rtf +21 -0
- data/examples/06_basic_list.rb +21 -0
- data/examples/07.rtf +28 -0
- data/examples/07_nested_list.rb +27 -0
- data/examples/08.rtf +807 -0
- data/examples/08_images.rb +17 -0
- data/examples/09.rtf +84 -0
- data/examples/09_shapes.rb +56 -0
- data/examples/10.rtf +34 -0
- data/examples/10_stylesheet.rb +18 -0
- data/examples/resources/images/redshirt.png +0 -0
- data/examples/resources/images/redshirts.jpg +0 -0
- data/examples/resources/json/redshirt_styles.json +72 -8
- data/examples/~$01.rtf +0 -0
- data/lib/rrtf.rb +4 -16
- data/lib/rrtf/colour.rb +8 -0
- data/lib/rrtf/formatting.rb +988 -0
- data/lib/rrtf/node.rb +17 -1851
- data/lib/rrtf/node/command_node.rb +242 -0
- data/lib/rrtf/node/container_node.rb +75 -0
- data/lib/rrtf/node/document.rb +339 -0
- data/lib/rrtf/node/footer_node.rb +47 -0
- data/lib/rrtf/node/geometry_node.rb +65 -0
- data/lib/rrtf/node/header_node.rb +47 -0
- data/lib/rrtf/node/image_node.rb +175 -0
- data/lib/rrtf/node/link_node.rb +10 -0
- data/lib/rrtf/node/list_level_node.rb +44 -0
- data/lib/rrtf/node/list_node.rb +30 -0
- data/lib/rrtf/node/list_text_node.rb +22 -0
- data/lib/rrtf/node/node.rb +53 -0
- data/lib/rrtf/node/paragraph_node.rb +11 -0
- data/lib/rrtf/node/table_cell_node.rb +233 -0
- data/lib/rrtf/node/table_node.rb +136 -0
- data/lib/rrtf/node/table_row_node.rb +92 -0
- data/lib/rrtf/node/text_node.rb +76 -0
- data/lib/rrtf/page.rb +7 -0
- data/lib/rrtf/page/margin.rb +98 -0
- data/lib/rrtf/page/size.rb +98 -0
- data/lib/rrtf/properties.rb +3 -0
- data/lib/rrtf/properties/document_properties.rb +34 -0
- data/lib/rrtf/properties/geometry_properties.rb +380 -0
- data/lib/rrtf/properties/properties.rb +13 -0
- data/lib/rrtf/style.rb +4 -5
- data/lib/rrtf/style/anonymous_style.rb +73 -0
- data/lib/rrtf/style/border_style.rb +27 -0
- data/lib/rrtf/style/character_style.rb +1 -7
- data/lib/rrtf/style/paragraph_style.rb +0 -6
- data/lib/rrtf/style/position_style.rb +26 -0
- data/lib/rrtf/style/shading_style.rb +26 -0
- data/lib/rrtf/style/style.rb +60 -101
- data/lib/rrtf/utilities.rb +138 -0
- data/lib/rrtf/version.rb +1 -1
- data/rrtf.gemspec +1 -0
- metadata +85 -10
- data/examples/01_mac_libreoffice5_2_3_3.png +0 -0
- data/examples/01_mac_pages6_2.png +0 -0
- data/examples/01_mac_textedit1_12.png +0 -0
- data/examples/01_mac_word15_36.png +0 -0
- data/examples/01_styles_and_paragraphs.rb +0 -32
- data/lib/rrtf/paper.rb +0 -53
- data/lib/rrtf/style/document_style.rb +0 -116
- data/lib/rrtf/style/formatting.rb +0 -320
|
@@ -0,0 +1,954 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html>
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="utf-8">
|
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
6
|
+
<title>
|
|
7
|
+
Module: RRTF::PageFormatting
|
|
8
|
+
|
|
9
|
+
— Documentation by YARD 0.9.9
|
|
10
|
+
|
|
11
|
+
</title>
|
|
12
|
+
|
|
13
|
+
<link rel="stylesheet" href="../css/style.css" type="text/css" charset="utf-8" />
|
|
14
|
+
|
|
15
|
+
<link rel="stylesheet" href="../css/common.css" type="text/css" charset="utf-8" />
|
|
16
|
+
|
|
17
|
+
<script type="text/javascript" charset="utf-8">
|
|
18
|
+
pathId = "RRTF::PageFormatting";
|
|
19
|
+
relpath = '../';
|
|
20
|
+
</script>
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
<script type="text/javascript" charset="utf-8" src="../js/jquery.js"></script>
|
|
24
|
+
|
|
25
|
+
<script type="text/javascript" charset="utf-8" src="../js/app.js"></script>
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
</head>
|
|
29
|
+
<body>
|
|
30
|
+
<div class="nav_wrap">
|
|
31
|
+
<iframe id="nav" src="../class_list.html?1"></iframe>
|
|
32
|
+
<div id="resizer"></div>
|
|
33
|
+
</div>
|
|
34
|
+
|
|
35
|
+
<div id="main" tabindex="-1">
|
|
36
|
+
<div id="header">
|
|
37
|
+
<div id="menu">
|
|
38
|
+
|
|
39
|
+
<a href="../_index.html">Index (P)</a> »
|
|
40
|
+
<span class='title'><span class='object_link'><a href="../RRTF.html" title="RRTF (module)">RRTF</a></span></span>
|
|
41
|
+
»
|
|
42
|
+
<span class="title">PageFormatting</span>
|
|
43
|
+
|
|
44
|
+
</div>
|
|
45
|
+
|
|
46
|
+
<div id="search">
|
|
47
|
+
|
|
48
|
+
<a class="full_list_link" id="class_list_link"
|
|
49
|
+
href="../class_list.html">
|
|
50
|
+
|
|
51
|
+
<svg width="24" height="24">
|
|
52
|
+
<rect x="0" y="4" width="24" height="4" rx="1" ry="1"></rect>
|
|
53
|
+
<rect x="0" y="12" width="24" height="4" rx="1" ry="1"></rect>
|
|
54
|
+
<rect x="0" y="20" width="24" height="4" rx="1" ry="1"></rect>
|
|
55
|
+
</svg>
|
|
56
|
+
</a>
|
|
57
|
+
|
|
58
|
+
</div>
|
|
59
|
+
<div class="clear"></div>
|
|
60
|
+
</div>
|
|
61
|
+
|
|
62
|
+
<div id="content"><h1>Module: RRTF::PageFormatting
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
</h1>
|
|
67
|
+
<div class="box_info">
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
<dl>
|
|
78
|
+
<dt>Included in:</dt>
|
|
79
|
+
<dd><span class='object_link'><a href="DocumentProperties.html" title="RRTF::DocumentProperties (class)">DocumentProperties</a></span></dd>
|
|
80
|
+
</dl>
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
|
|
84
|
+
<dl>
|
|
85
|
+
<dt>Defined in:</dt>
|
|
86
|
+
<dd>lib/rrtf/formatting.rb</dd>
|
|
87
|
+
</dl>
|
|
88
|
+
|
|
89
|
+
</div>
|
|
90
|
+
|
|
91
|
+
<h2>Overview</h2><div class="docstring">
|
|
92
|
+
<div class="discussion">
|
|
93
|
+
|
|
94
|
+
<p>Page formatting attributes and methods.</p>
|
|
95
|
+
|
|
96
|
+
|
|
97
|
+
</div>
|
|
98
|
+
</div>
|
|
99
|
+
<div class="tags">
|
|
100
|
+
|
|
101
|
+
<p class="tag_title">Author:</p>
|
|
102
|
+
<ul class="author">
|
|
103
|
+
|
|
104
|
+
<li>
|
|
105
|
+
|
|
106
|
+
|
|
107
|
+
|
|
108
|
+
|
|
109
|
+
|
|
110
|
+
<div class='inline'>
|
|
111
|
+
<p>Wesley Hileman</p>
|
|
112
|
+
</div>
|
|
113
|
+
|
|
114
|
+
</li>
|
|
115
|
+
|
|
116
|
+
</ul>
|
|
117
|
+
<p class="tag_title">Since:</p>
|
|
118
|
+
<ul class="since">
|
|
119
|
+
|
|
120
|
+
<li>
|
|
121
|
+
|
|
122
|
+
|
|
123
|
+
|
|
124
|
+
|
|
125
|
+
|
|
126
|
+
<div class='inline'>
|
|
127
|
+
<p>1.0.0</p>
|
|
128
|
+
</div>
|
|
129
|
+
|
|
130
|
+
</li>
|
|
131
|
+
|
|
132
|
+
</ul>
|
|
133
|
+
|
|
134
|
+
</div>
|
|
135
|
+
<h2>Constant Summary</h2>
|
|
136
|
+
<dl class="constants">
|
|
137
|
+
|
|
138
|
+
<dt id="PAGE_ATTRIBUTES-constant" class="">PAGE_ATTRIBUTES =
|
|
139
|
+
<div class="docstring">
|
|
140
|
+
<div class="discussion">
|
|
141
|
+
|
|
142
|
+
<p>Formatting attributes that can be applied to an RTF document or a section
|
|
143
|
+
in a document.</p>
|
|
144
|
+
|
|
145
|
+
|
|
146
|
+
</div>
|
|
147
|
+
</div>
|
|
148
|
+
<div class="tags">
|
|
149
|
+
|
|
150
|
+
<p class="tag_title">Returns:</p>
|
|
151
|
+
<ul class="return">
|
|
152
|
+
|
|
153
|
+
<li>
|
|
154
|
+
|
|
155
|
+
|
|
156
|
+
<span class='type'>(<tt>Hash<String, Hash></tt>)</span>
|
|
157
|
+
|
|
158
|
+
|
|
159
|
+
|
|
160
|
+
—
|
|
161
|
+
<div class='inline'>
|
|
162
|
+
<p>a hash mapping each attribute to a hash that describes (1) the
|
|
163
|
+
attribute's default value, (2) how to parse the attribute from the
|
|
164
|
+
user, and (3) how to convert the attribute to an RTF sequence.</p>
|
|
165
|
+
</div>
|
|
166
|
+
|
|
167
|
+
</li>
|
|
168
|
+
|
|
169
|
+
</ul>
|
|
170
|
+
<p class="tag_title">Since:</p>
|
|
171
|
+
<ul class="since">
|
|
172
|
+
|
|
173
|
+
<li>
|
|
174
|
+
|
|
175
|
+
|
|
176
|
+
|
|
177
|
+
|
|
178
|
+
|
|
179
|
+
<div class='inline'>
|
|
180
|
+
<p>1.0.0</p>
|
|
181
|
+
</div>
|
|
182
|
+
|
|
183
|
+
</li>
|
|
184
|
+
|
|
185
|
+
</ul>
|
|
186
|
+
|
|
187
|
+
</div>
|
|
188
|
+
</dt>
|
|
189
|
+
<dd><pre class="code"><span class='lbrace'>{</span>
|
|
190
|
+
<span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>orientation</span><span class='tstring_end'>"</span></span> <span class='op'>=></span> <span class='lbrace'>{</span>
|
|
191
|
+
<span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>default</span><span class='tstring_end'>"</span></span> <span class='op'>=></span> <span class='symbol'>:portrait</span><span class='comma'>,</span>
|
|
192
|
+
<span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>dictionary</span><span class='tstring_end'>"</span></span> <span class='op'>=></span> <span class='lbrace'>{</span>
|
|
193
|
+
<span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>PORTRAIT</span><span class='tstring_end'>"</span></span> <span class='op'>=></span> <span class='symbol'>:portrait</span><span class='comma'>,</span>
|
|
194
|
+
<span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>LANDSCAPE</span><span class='tstring_end'>"</span></span> <span class='op'>=></span> <span class='symbol'>:landscape</span>
|
|
195
|
+
<span class='rbrace'>}</span><span class='comma'>,</span>
|
|
196
|
+
<span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>to_rtf</span><span class='tstring_end'>"</span></span> <span class='op'>=></span> <span class='id identifier rubyid_lambda'>lambda</span><span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_value'>value</span><span class='op'>|</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>\\landscape</span><span class='tstring_end'>"</span></span> <span class='kw'>if</span> <span class='id identifier rubyid_value'>value</span> <span class='op'>==</span> <span class='symbol'>:landscape</span> <span class='rbrace'>}</span>
|
|
197
|
+
<span class='rbrace'>}</span><span class='comma'>,</span>
|
|
198
|
+
<span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>size</span><span class='tstring_end'>"</span></span> <span class='op'>=></span> <span class='lbrace'>{</span>
|
|
199
|
+
<span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>default</span><span class='tstring_end'>"</span></span> <span class='op'>=></span> <span class='const'><span class='object_link'><a href="../RRTF.html" title="RRTF (module)">RRTF</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="Page.html" title="RRTF::Page (module)">Page</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="Page/Size.html" title="RRTF::Page::Size (class)">Size</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="Page/Size.html#initialize-instance_method" title="RRTF::Page::Size#initialize (method)">new</a></span></span><span class='comma'>,</span>
|
|
200
|
+
<span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>from_user</span><span class='tstring_end'>"</span></span> <span class='op'>=></span> <span class='id identifier rubyid_lambda'>lambda</span><span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_value'>value</span><span class='op'>|</span> <span class='const'><span class='object_link'><a href="../RRTF.html" title="RRTF (module)">RRTF</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="Page.html" title="RRTF::Page (module)">Page</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="Page/Size.html" title="RRTF::Page::Size (class)">Size</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="Page/Size.html#initialize-instance_method" title="RRTF::Page::Size#initialize (method)">new</a></span></span><span class='lparen'>(</span><span class='id identifier rubyid_value'>value</span><span class='rparen'>)</span> <span class='rbrace'>}</span><span class='comma'>,</span>
|
|
201
|
+
<span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>to_rtf</span><span class='tstring_end'>"</span></span> <span class='op'>=></span> <span class='id identifier rubyid_lambda'>lambda</span><span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_value'>value</span><span class='op'>|</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>\\paperw</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_value'>value</span><span class='period'>.</span><span class='id identifier rubyid_width'>width</span><span class='embexpr_end'>}</span><span class='tstring_content'>\\paperh</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_value'>value</span><span class='period'>.</span><span class='id identifier rubyid_height'>height</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span> <span class='rbrace'>}</span>
|
|
202
|
+
<span class='rbrace'>}</span><span class='comma'>,</span>
|
|
203
|
+
<span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>margin</span><span class='tstring_end'>"</span></span> <span class='op'>=></span> <span class='lbrace'>{</span>
|
|
204
|
+
<span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>default</span><span class='tstring_end'>"</span></span> <span class='op'>=></span> <span class='const'><span class='object_link'><a href="../RRTF.html" title="RRTF (module)">RRTF</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="Page.html" title="RRTF::Page (module)">Page</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="Page/Margin.html" title="RRTF::Page::Margin (class)">Margin</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="Page/Margin.html#initialize-instance_method" title="RRTF::Page::Margin#initialize (method)">new</a></span></span><span class='comma'>,</span>
|
|
205
|
+
<span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>from_user</span><span class='tstring_end'>"</span></span> <span class='op'>=></span> <span class='id identifier rubyid_lambda'>lambda</span><span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_value'>value</span><span class='op'>|</span> <span class='const'><span class='object_link'><a href="../RRTF.html" title="RRTF (module)">RRTF</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="Page.html" title="RRTF::Page (module)">Page</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="Page/Margin.html" title="RRTF::Page::Margin (class)">Margin</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="Page/Margin.html#initialize-instance_method" title="RRTF::Page::Margin#initialize (method)">new</a></span></span><span class='lparen'>(</span><span class='id identifier rubyid_value'>value</span><span class='rparen'>)</span> <span class='rbrace'>}</span><span class='comma'>,</span>
|
|
206
|
+
<span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>to_rtf</span><span class='tstring_end'>"</span></span> <span class='op'>=></span> <span class='id identifier rubyid_lambda'>lambda</span><span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_value'>value</span><span class='op'>|</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>\\margl</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_value'>value</span><span class='period'>.</span><span class='id identifier rubyid_left'>left</span><span class='embexpr_end'>}</span><span class='tstring_content'>\\margr</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_value'>value</span><span class='period'>.</span><span class='id identifier rubyid_right'>right</span><span class='embexpr_end'>}</span><span class='tstring_content'>\\margt</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_value'>value</span><span class='period'>.</span><span class='id identifier rubyid_top'>top</span><span class='embexpr_end'>}</span><span class='tstring_content'>\\margb</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_value'>value</span><span class='period'>.</span><span class='id identifier rubyid_bottom'>bottom</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span> <span class='rbrace'>}</span>
|
|
207
|
+
<span class='rbrace'>}</span><span class='comma'>,</span>
|
|
208
|
+
<span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>gutter</span><span class='tstring_end'>"</span></span> <span class='op'>=></span> <span class='lbrace'>{</span>
|
|
209
|
+
<span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>default</span><span class='tstring_end'>"</span></span> <span class='op'>=></span> <span class='kw'>nil</span><span class='comma'>,</span>
|
|
210
|
+
<span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>from_user</span><span class='tstring_end'>"</span></span> <span class='op'>=></span> <span class='id identifier rubyid_lambda'>lambda</span><span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_value'>value</span><span class='op'>|</span> <span class='const'><span class='object_link'><a href="../RRTF.html" title="RRTF (module)">RRTF</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="Utilities.html" title="RRTF::Utilities (class)">Utilities</a></span></span><span class='period'>.</span><span class='id identifier rubyid_value2twips'><span class='object_link'><a href="Utilities.html#value2twips-class_method" title="RRTF::Utilities.value2twips (method)">value2twips</a></span></span><span class='lparen'>(</span><span class='id identifier rubyid_value'>value</span><span class='rparen'>)</span> <span class='rbrace'>}</span><span class='comma'>,</span>
|
|
211
|
+
<span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>to_rtf</span><span class='tstring_end'>"</span></span> <span class='op'>=></span> <span class='id identifier rubyid_lambda'>lambda</span><span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_value'>value</span><span class='op'>|</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>\\gutter</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_value'>value</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span> <span class='kw'>unless</span> <span class='id identifier rubyid_value'>value</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span> <span class='rbrace'>}</span>
|
|
212
|
+
<span class='rbrace'>}</span>
|
|
213
|
+
<span class='rbrace'>}</span><span class='period'>.</span><span class='id identifier rubyid_freeze'>freeze</span></pre></dd>
|
|
214
|
+
|
|
215
|
+
</dl>
|
|
216
|
+
|
|
217
|
+
|
|
218
|
+
|
|
219
|
+
|
|
220
|
+
|
|
221
|
+
|
|
222
|
+
|
|
223
|
+
|
|
224
|
+
<h2>
|
|
225
|
+
Class Method Summary
|
|
226
|
+
<small><a href="#" class="summary_toggle">collapse</a></small>
|
|
227
|
+
</h2>
|
|
228
|
+
|
|
229
|
+
<ul class="summary">
|
|
230
|
+
|
|
231
|
+
<li class="public ">
|
|
232
|
+
<span class="summary_signature">
|
|
233
|
+
|
|
234
|
+
<a href="#included-class_method" title="included (class method)">.<strong>included</strong>(base) ⇒ Object </a>
|
|
235
|
+
|
|
236
|
+
|
|
237
|
+
|
|
238
|
+
</span>
|
|
239
|
+
|
|
240
|
+
|
|
241
|
+
|
|
242
|
+
|
|
243
|
+
|
|
244
|
+
|
|
245
|
+
|
|
246
|
+
|
|
247
|
+
|
|
248
|
+
<span class="summary_desc"><div class='inline'>
|
|
249
|
+
<p>Generates attribute accessors for all page attributes when the module is
|
|
250
|
+
included in another module or class.</p>
|
|
251
|
+
</div></span>
|
|
252
|
+
|
|
253
|
+
</li>
|
|
254
|
+
|
|
255
|
+
|
|
256
|
+
</ul>
|
|
257
|
+
|
|
258
|
+
<h2>
|
|
259
|
+
Instance Method Summary
|
|
260
|
+
<small><a href="#" class="summary_toggle">collapse</a></small>
|
|
261
|
+
</h2>
|
|
262
|
+
|
|
263
|
+
<ul class="summary">
|
|
264
|
+
|
|
265
|
+
<li class="public ">
|
|
266
|
+
<span class="summary_signature">
|
|
267
|
+
|
|
268
|
+
<a href="#body_height-instance_method" title="#body_height (instance method)">#<strong>body_height</strong> ⇒ Object </a>
|
|
269
|
+
|
|
270
|
+
|
|
271
|
+
|
|
272
|
+
</span>
|
|
273
|
+
|
|
274
|
+
|
|
275
|
+
|
|
276
|
+
|
|
277
|
+
|
|
278
|
+
|
|
279
|
+
|
|
280
|
+
|
|
281
|
+
|
|
282
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
|
283
|
+
|
|
284
|
+
</li>
|
|
285
|
+
|
|
286
|
+
|
|
287
|
+
<li class="public ">
|
|
288
|
+
<span class="summary_signature">
|
|
289
|
+
|
|
290
|
+
<a href="#body_width-instance_method" title="#body_width (instance method)">#<strong>body_width</strong> ⇒ Object </a>
|
|
291
|
+
|
|
292
|
+
|
|
293
|
+
|
|
294
|
+
</span>
|
|
295
|
+
|
|
296
|
+
|
|
297
|
+
|
|
298
|
+
|
|
299
|
+
|
|
300
|
+
|
|
301
|
+
|
|
302
|
+
|
|
303
|
+
|
|
304
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
|
305
|
+
|
|
306
|
+
</li>
|
|
307
|
+
|
|
308
|
+
|
|
309
|
+
<li class="public ">
|
|
310
|
+
<span class="summary_signature">
|
|
311
|
+
|
|
312
|
+
<a href="#initialize_page_formatting-instance_method" title="#initialize_page_formatting (instance method)">#<strong>initialize_page_formatting</strong>(options = {}) ⇒ Object </a>
|
|
313
|
+
|
|
314
|
+
|
|
315
|
+
|
|
316
|
+
</span>
|
|
317
|
+
|
|
318
|
+
|
|
319
|
+
|
|
320
|
+
|
|
321
|
+
|
|
322
|
+
|
|
323
|
+
|
|
324
|
+
|
|
325
|
+
|
|
326
|
+
<span class="summary_desc"><div class='inline'>
|
|
327
|
+
<p>Initializes page formatting attributes.</p>
|
|
328
|
+
</div></span>
|
|
329
|
+
|
|
330
|
+
</li>
|
|
331
|
+
|
|
332
|
+
|
|
333
|
+
<li class="public ">
|
|
334
|
+
<span class="summary_signature">
|
|
335
|
+
|
|
336
|
+
<a href="#page_formatting_to_rtf-instance_method" title="#page_formatting_to_rtf (instance method)">#<strong>page_formatting_to_rtf</strong> ⇒ String </a>
|
|
337
|
+
|
|
338
|
+
|
|
339
|
+
|
|
340
|
+
</span>
|
|
341
|
+
|
|
342
|
+
|
|
343
|
+
|
|
344
|
+
|
|
345
|
+
|
|
346
|
+
|
|
347
|
+
|
|
348
|
+
|
|
349
|
+
|
|
350
|
+
<span class="summary_desc"><div class='inline'>
|
|
351
|
+
<p>Generates an RTF string representing all applied page formatting.</p>
|
|
352
|
+
</div></span>
|
|
353
|
+
|
|
354
|
+
</li>
|
|
355
|
+
|
|
356
|
+
|
|
357
|
+
<li class="public ">
|
|
358
|
+
<span class="summary_signature">
|
|
359
|
+
|
|
360
|
+
<a href="#set_page_formatting_from_hashmap-instance_method" title="#set_page_formatting_from_hashmap (instance method)">#<strong>set_page_formatting_from_hashmap</strong>(hash) ⇒ Object </a>
|
|
361
|
+
|
|
362
|
+
|
|
363
|
+
|
|
364
|
+
</span>
|
|
365
|
+
|
|
366
|
+
|
|
367
|
+
|
|
368
|
+
|
|
369
|
+
|
|
370
|
+
|
|
371
|
+
|
|
372
|
+
|
|
373
|
+
|
|
374
|
+
<span class="summary_desc"><div class='inline'>
|
|
375
|
+
<p>Sets document formatting attributes according to the supplied hashmap.</p>
|
|
376
|
+
</div></span>
|
|
377
|
+
|
|
378
|
+
</li>
|
|
379
|
+
|
|
380
|
+
|
|
381
|
+
</ul>
|
|
382
|
+
|
|
383
|
+
|
|
384
|
+
|
|
385
|
+
|
|
386
|
+
<div id="class_method_details" class="method_details_list">
|
|
387
|
+
<h2>Class Method Details</h2>
|
|
388
|
+
|
|
389
|
+
|
|
390
|
+
<div class="method_details first">
|
|
391
|
+
<h3 class="signature first" id="included-class_method">
|
|
392
|
+
|
|
393
|
+
.<strong>included</strong>(base) ⇒ <tt>Object</tt>
|
|
394
|
+
|
|
395
|
+
|
|
396
|
+
|
|
397
|
+
|
|
398
|
+
|
|
399
|
+
</h3><div class="docstring">
|
|
400
|
+
<div class="discussion">
|
|
401
|
+
|
|
402
|
+
<p>Generates attribute accessors for all page attributes when the module is
|
|
403
|
+
included in another module or class.</p>
|
|
404
|
+
|
|
405
|
+
|
|
406
|
+
</div>
|
|
407
|
+
</div>
|
|
408
|
+
<div class="tags">
|
|
409
|
+
|
|
410
|
+
<p class="tag_title">Since:</p>
|
|
411
|
+
<ul class="since">
|
|
412
|
+
|
|
413
|
+
<li>
|
|
414
|
+
|
|
415
|
+
|
|
416
|
+
|
|
417
|
+
|
|
418
|
+
|
|
419
|
+
<div class='inline'>
|
|
420
|
+
<p>1.0.0</p>
|
|
421
|
+
</div>
|
|
422
|
+
|
|
423
|
+
</li>
|
|
424
|
+
|
|
425
|
+
</ul>
|
|
426
|
+
|
|
427
|
+
</div><table class="source_code">
|
|
428
|
+
<tr>
|
|
429
|
+
<td>
|
|
430
|
+
<pre class="lines">
|
|
431
|
+
|
|
432
|
+
|
|
433
|
+
912
|
|
434
|
+
913
|
|
435
|
+
914
|
|
436
|
+
915
|
|
437
|
+
916
|
|
438
|
+
917
|
|
439
|
+
918
|
|
440
|
+
919</pre>
|
|
441
|
+
</td>
|
|
442
|
+
<td>
|
|
443
|
+
<pre class="code"><span class="info file"># File 'lib/rrtf/formatting.rb', line 912</span>
|
|
444
|
+
|
|
445
|
+
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_included'>included</span><span class='lparen'>(</span><span class='id identifier rubyid_base'>base</span><span class='rparen'>)</span>
|
|
446
|
+
<span class='comment'># define accessors in base for document attributes
|
|
447
|
+
</span> <span class='id identifier rubyid_base'>base</span><span class='period'>.</span><span class='id identifier rubyid_class_eval'>class_eval</span> <span class='kw'>do</span>
|
|
448
|
+
<span class='const'><span class='object_link'><a href="#PAGE_ATTRIBUTES-constant" title="RRTF::PageFormatting::PAGE_ATTRIBUTES (constant)">PAGE_ATTRIBUTES</a></span></span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_key'>key</span><span class='comma'>,</span> <span class='id identifier rubyid_options'>options</span><span class='op'>|</span>
|
|
449
|
+
<span class='id identifier rubyid_attr_accessor'>attr_accessor</span> <span class='symbol'>:#{</span><span class='id identifier rubyid_key'>key</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span>
|
|
450
|
+
<span class='kw'>end</span> <span class='comment'># each
|
|
451
|
+
</span> <span class='kw'>end</span> <span class='comment'># class_eval
|
|
452
|
+
</span><span class='kw'>end</span></pre>
|
|
453
|
+
</td>
|
|
454
|
+
</tr>
|
|
455
|
+
</table>
|
|
456
|
+
</div>
|
|
457
|
+
|
|
458
|
+
</div>
|
|
459
|
+
|
|
460
|
+
<div id="instance_method_details" class="method_details_list">
|
|
461
|
+
<h2>Instance Method Details</h2>
|
|
462
|
+
|
|
463
|
+
|
|
464
|
+
<div class="method_details first">
|
|
465
|
+
<h3 class="signature first" id="body_height-instance_method">
|
|
466
|
+
|
|
467
|
+
#<strong>body_height</strong> ⇒ <tt>Object</tt>
|
|
468
|
+
|
|
469
|
+
|
|
470
|
+
|
|
471
|
+
|
|
472
|
+
|
|
473
|
+
</h3><div class="docstring">
|
|
474
|
+
<div class="discussion">
|
|
475
|
+
|
|
476
|
+
|
|
477
|
+
</div>
|
|
478
|
+
</div>
|
|
479
|
+
<div class="tags">
|
|
480
|
+
|
|
481
|
+
<p class="tag_title">Since:</p>
|
|
482
|
+
<ul class="since">
|
|
483
|
+
|
|
484
|
+
<li>
|
|
485
|
+
|
|
486
|
+
|
|
487
|
+
|
|
488
|
+
|
|
489
|
+
|
|
490
|
+
<div class='inline'>
|
|
491
|
+
<p>1.0.0</p>
|
|
492
|
+
</div>
|
|
493
|
+
|
|
494
|
+
</li>
|
|
495
|
+
|
|
496
|
+
</ul>
|
|
497
|
+
|
|
498
|
+
</div><table class="source_code">
|
|
499
|
+
<tr>
|
|
500
|
+
<td>
|
|
501
|
+
<pre class="lines">
|
|
502
|
+
|
|
503
|
+
|
|
504
|
+
981
|
|
505
|
+
982
|
|
506
|
+
983
|
|
507
|
+
984
|
|
508
|
+
985
|
|
509
|
+
986
|
|
510
|
+
987</pre>
|
|
511
|
+
</td>
|
|
512
|
+
<td>
|
|
513
|
+
<pre class="code"><span class="info file"># File 'lib/rrtf/formatting.rb', line 981</span>
|
|
514
|
+
|
|
515
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_body_height'>body_height</span>
|
|
516
|
+
<span class='kw'>if</span> <span class='id identifier rubyid_orientation'>orientation</span> <span class='op'>==</span> <span class='symbol'>:portrait</span>
|
|
517
|
+
<span class='id identifier rubyid_size'>size</span><span class='period'>.</span><span class='id identifier rubyid_height'>height</span> <span class='op'>-</span> <span class='lparen'>(</span><span class='id identifier rubyid_margin'>margin</span><span class='period'>.</span><span class='id identifier rubyid_top'>top</span> <span class='op'>+</span> <span class='id identifier rubyid_margin'>margin</span><span class='period'>.</span><span class='id identifier rubyid_bottom'>bottom</span><span class='rparen'>)</span>
|
|
518
|
+
<span class='kw'>else</span>
|
|
519
|
+
<span class='id identifier rubyid_size'>size</span><span class='period'>.</span><span class='id identifier rubyid_width'>width</span> <span class='op'>-</span> <span class='lparen'>(</span><span class='id identifier rubyid_margin'>margin</span><span class='period'>.</span><span class='id identifier rubyid_left'>left</span> <span class='op'>+</span> <span class='id identifier rubyid_margin'>margin</span><span class='period'>.</span><span class='id identifier rubyid_right'>right</span><span class='rparen'>)</span>
|
|
520
|
+
<span class='kw'>end</span>
|
|
521
|
+
<span class='kw'>end</span></pre>
|
|
522
|
+
</td>
|
|
523
|
+
</tr>
|
|
524
|
+
</table>
|
|
525
|
+
</div>
|
|
526
|
+
|
|
527
|
+
<div class="method_details ">
|
|
528
|
+
<h3 class="signature " id="body_width-instance_method">
|
|
529
|
+
|
|
530
|
+
#<strong>body_width</strong> ⇒ <tt>Object</tt>
|
|
531
|
+
|
|
532
|
+
|
|
533
|
+
|
|
534
|
+
|
|
535
|
+
|
|
536
|
+
</h3><div class="docstring">
|
|
537
|
+
<div class="discussion">
|
|
538
|
+
|
|
539
|
+
|
|
540
|
+
</div>
|
|
541
|
+
</div>
|
|
542
|
+
<div class="tags">
|
|
543
|
+
|
|
544
|
+
<p class="tag_title">Since:</p>
|
|
545
|
+
<ul class="since">
|
|
546
|
+
|
|
547
|
+
<li>
|
|
548
|
+
|
|
549
|
+
|
|
550
|
+
|
|
551
|
+
|
|
552
|
+
|
|
553
|
+
<div class='inline'>
|
|
554
|
+
<p>1.0.0</p>
|
|
555
|
+
</div>
|
|
556
|
+
|
|
557
|
+
</li>
|
|
558
|
+
|
|
559
|
+
</ul>
|
|
560
|
+
|
|
561
|
+
</div><table class="source_code">
|
|
562
|
+
<tr>
|
|
563
|
+
<td>
|
|
564
|
+
<pre class="lines">
|
|
565
|
+
|
|
566
|
+
|
|
567
|
+
973
|
|
568
|
+
974
|
|
569
|
+
975
|
|
570
|
+
976
|
|
571
|
+
977
|
|
572
|
+
978
|
|
573
|
+
979</pre>
|
|
574
|
+
</td>
|
|
575
|
+
<td>
|
|
576
|
+
<pre class="code"><span class="info file"># File 'lib/rrtf/formatting.rb', line 973</span>
|
|
577
|
+
|
|
578
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_body_width'>body_width</span>
|
|
579
|
+
<span class='kw'>if</span> <span class='id identifier rubyid_orientation'>orientation</span> <span class='op'>==</span> <span class='symbol'>:portrait</span>
|
|
580
|
+
<span class='id identifier rubyid_size'>size</span><span class='period'>.</span><span class='id identifier rubyid_width'>width</span> <span class='op'>-</span> <span class='lparen'>(</span><span class='id identifier rubyid_margin'>margin</span><span class='period'>.</span><span class='id identifier rubyid_left'>left</span> <span class='op'>+</span> <span class='id identifier rubyid_margin'>margin</span><span class='period'>.</span><span class='id identifier rubyid_right'>right</span><span class='rparen'>)</span>
|
|
581
|
+
<span class='kw'>else</span>
|
|
582
|
+
<span class='id identifier rubyid_size'>size</span><span class='period'>.</span><span class='id identifier rubyid_height'>height</span> <span class='op'>-</span> <span class='lparen'>(</span><span class='id identifier rubyid_margin'>margin</span><span class='period'>.</span><span class='id identifier rubyid_top'>top</span> <span class='op'>+</span> <span class='id identifier rubyid_margin'>margin</span><span class='period'>.</span><span class='id identifier rubyid_bottom'>bottom</span><span class='rparen'>)</span>
|
|
583
|
+
<span class='kw'>end</span>
|
|
584
|
+
<span class='kw'>end</span></pre>
|
|
585
|
+
</td>
|
|
586
|
+
</tr>
|
|
587
|
+
</table>
|
|
588
|
+
</div>
|
|
589
|
+
|
|
590
|
+
<div class="method_details ">
|
|
591
|
+
<h3 class="signature " id="initialize_page_formatting-instance_method">
|
|
592
|
+
|
|
593
|
+
#<strong>initialize_page_formatting</strong>(options = {}) ⇒ <tt>Object</tt>
|
|
594
|
+
|
|
595
|
+
|
|
596
|
+
|
|
597
|
+
|
|
598
|
+
|
|
599
|
+
</h3><div class="docstring">
|
|
600
|
+
<div class="discussion">
|
|
601
|
+
|
|
602
|
+
<div class="note notetag">
|
|
603
|
+
<strong>Note:</strong>
|
|
604
|
+
<div class='inline'>
|
|
605
|
+
<p>The behavior of the “gutter” option changes with the document
|
|
606
|
+
“facing_pages” setting.</p>
|
|
607
|
+
</div>
|
|
608
|
+
</div>
|
|
609
|
+
|
|
610
|
+
|
|
611
|
+
<p>Initializes page formatting attributes.</p>
|
|
612
|
+
|
|
613
|
+
|
|
614
|
+
</div>
|
|
615
|
+
</div>
|
|
616
|
+
<div class="tags">
|
|
617
|
+
<p class="tag_title">Parameters:</p>
|
|
618
|
+
<ul class="param">
|
|
619
|
+
|
|
620
|
+
<li>
|
|
621
|
+
|
|
622
|
+
<span class='name'>options</span>
|
|
623
|
+
|
|
624
|
+
|
|
625
|
+
<span class='type'>(<tt>Hash</tt>)</span>
|
|
626
|
+
|
|
627
|
+
|
|
628
|
+
<em class="default">(defaults to: <tt>{}</tt>)</em>
|
|
629
|
+
|
|
630
|
+
|
|
631
|
+
—
|
|
632
|
+
<div class='inline'>
|
|
633
|
+
<p>the document formatting options.</p>
|
|
634
|
+
</div>
|
|
635
|
+
|
|
636
|
+
</li>
|
|
637
|
+
|
|
638
|
+
</ul>
|
|
639
|
+
|
|
640
|
+
|
|
641
|
+
|
|
642
|
+
|
|
643
|
+
<p class="tag_title">Options Hash (<tt>options</tt>):</p>
|
|
644
|
+
<ul class="option">
|
|
645
|
+
|
|
646
|
+
<li>
|
|
647
|
+
<span class="name">"orientation"</span>
|
|
648
|
+
<span class="type">(<tt>String</tt>)</span>
|
|
649
|
+
<span class="default">
|
|
650
|
+
|
|
651
|
+
— default:
|
|
652
|
+
<tt>"PORTRAIT"</tt>
|
|
653
|
+
|
|
654
|
+
</span>
|
|
655
|
+
|
|
656
|
+
— <div class='inline'>
|
|
657
|
+
<p>the orientation of the paper (“PORTRAIT” or “LANDSCAPE”).</p>
|
|
658
|
+
</div>
|
|
659
|
+
|
|
660
|
+
</li>
|
|
661
|
+
|
|
662
|
+
<li>
|
|
663
|
+
<span class="name">"size"</span>
|
|
664
|
+
<span class="type">(<tt>String</tt>, <tt><span class='object_link'><a href="Page/Size.html" title="RRTF::Page::Size (class)">Page::Size</a></span></tt>)</span>
|
|
665
|
+
<span class="default">
|
|
666
|
+
|
|
667
|
+
— default:
|
|
668
|
+
<tt>Page::Size.new</tt>
|
|
669
|
+
|
|
670
|
+
</span>
|
|
671
|
+
|
|
672
|
+
— <div class='inline'>
|
|
673
|
+
<p>the size of the paper (object or string; see <span class='object_link'><a href="Page/Size.html#initialize-instance_method" title="RRTF::Page::Size#initialize (method)">RRTF::Page::Size#initialize</a></span>).</p>
|
|
674
|
+
</div>
|
|
675
|
+
|
|
676
|
+
</li>
|
|
677
|
+
|
|
678
|
+
<li>
|
|
679
|
+
<span class="name">"margin"</span>
|
|
680
|
+
<span class="type">(<tt>String</tt>, <tt><span class='object_link'><a href="Page/Margin.html" title="RRTF::Page::Margin (class)">Page::Margin</a></span></tt>)</span>
|
|
681
|
+
<span class="default">
|
|
682
|
+
|
|
683
|
+
— default:
|
|
684
|
+
<tt>Page::Margin.new</tt>
|
|
685
|
+
|
|
686
|
+
</span>
|
|
687
|
+
|
|
688
|
+
— <div class='inline'>
|
|
689
|
+
<p>the paper margin (object or string; see <span class='object_link'><a href="Page/Margin.html#initialize-instance_method" title="RRTF::Page::Margin#initialize (method)">RRTF::Page::Margin#initialize</a></span>).</p>
|
|
690
|
+
</div>
|
|
691
|
+
|
|
692
|
+
</li>
|
|
693
|
+
|
|
694
|
+
<li>
|
|
695
|
+
<span class="name">"gutter"</span>
|
|
696
|
+
<span class="type">(<tt>String</tt>)</span>
|
|
697
|
+
<span class="default">
|
|
698
|
+
|
|
699
|
+
— default:
|
|
700
|
+
<tt>nil</tt>
|
|
701
|
+
|
|
702
|
+
</span>
|
|
703
|
+
|
|
704
|
+
— <div class='inline'>
|
|
705
|
+
<p>the page gutter width (specify a string, see <span class='object_link'><a href="Utilities.html#value2twips-class_method" title="RRTF::Utilities.value2twips (method)">Utilities.value2twips</a></span>).</p>
|
|
706
|
+
</div>
|
|
707
|
+
|
|
708
|
+
</li>
|
|
709
|
+
|
|
710
|
+
</ul>
|
|
711
|
+
|
|
712
|
+
|
|
713
|
+
<p class="tag_title">Since:</p>
|
|
714
|
+
<ul class="since">
|
|
715
|
+
|
|
716
|
+
<li>
|
|
717
|
+
|
|
718
|
+
|
|
719
|
+
|
|
720
|
+
|
|
721
|
+
|
|
722
|
+
<div class='inline'>
|
|
723
|
+
<p>1.0.0</p>
|
|
724
|
+
</div>
|
|
725
|
+
|
|
726
|
+
</li>
|
|
727
|
+
|
|
728
|
+
</ul>
|
|
729
|
+
|
|
730
|
+
</div><table class="source_code">
|
|
731
|
+
<tr>
|
|
732
|
+
<td>
|
|
733
|
+
<pre class="lines">
|
|
734
|
+
|
|
735
|
+
|
|
736
|
+
930
|
|
737
|
+
931
|
|
738
|
+
932
|
|
739
|
+
933
|
|
740
|
+
934
|
|
741
|
+
935
|
|
742
|
+
936
|
|
743
|
+
937</pre>
|
|
744
|
+
</td>
|
|
745
|
+
<td>
|
|
746
|
+
<pre class="code"><span class="info file"># File 'lib/rrtf/formatting.rb', line 930</span>
|
|
747
|
+
|
|
748
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_initialize_page_formatting'>initialize_page_formatting</span><span class='lparen'>(</span><span class='id identifier rubyid_options'>options</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span><span class='rparen'>)</span>
|
|
749
|
+
<span class='comment'># load default attribute values
|
|
750
|
+
</span> <span class='const'><span class='object_link'><a href="#PAGE_ATTRIBUTES-constant" title="RRTF::PageFormatting::PAGE_ATTRIBUTES (constant)">PAGE_ATTRIBUTES</a></span></span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_key'>key</span><span class='comma'>,</span> <span class='id identifier rubyid_options'>options</span><span class='op'>|</span>
|
|
751
|
+
<span class='id identifier rubyid_send'>send</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_key'>key</span><span class='embexpr_end'>}</span><span class='tstring_content'>=</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='id identifier rubyid_options'>options</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>default</span><span class='tstring_end'>"</span></span><span class='rbracket'>]</span><span class='rparen'>)</span>
|
|
752
|
+
<span class='kw'>end</span> <span class='comment'># each
|
|
753
|
+
</span> <span class='comment'># overwrite default attribute values with given values
|
|
754
|
+
</span> <span class='id identifier rubyid_set_page_formatting_from_hashmap'>set_page_formatting_from_hashmap</span><span class='lparen'>(</span><span class='id identifier rubyid_options'>options</span><span class='rparen'>)</span>
|
|
755
|
+
<span class='kw'>end</span></pre>
|
|
756
|
+
</td>
|
|
757
|
+
</tr>
|
|
758
|
+
</table>
|
|
759
|
+
</div>
|
|
760
|
+
|
|
761
|
+
<div class="method_details ">
|
|
762
|
+
<h3 class="signature " id="page_formatting_to_rtf-instance_method">
|
|
763
|
+
|
|
764
|
+
#<strong>page_formatting_to_rtf</strong> ⇒ <tt>String</tt>
|
|
765
|
+
|
|
766
|
+
|
|
767
|
+
|
|
768
|
+
|
|
769
|
+
|
|
770
|
+
</h3><div class="docstring">
|
|
771
|
+
<div class="discussion">
|
|
772
|
+
|
|
773
|
+
<p>Generates an RTF string representing all applied page formatting.</p>
|
|
774
|
+
|
|
775
|
+
|
|
776
|
+
</div>
|
|
777
|
+
</div>
|
|
778
|
+
<div class="tags">
|
|
779
|
+
|
|
780
|
+
<p class="tag_title">Returns:</p>
|
|
781
|
+
<ul class="return">
|
|
782
|
+
|
|
783
|
+
<li>
|
|
784
|
+
|
|
785
|
+
|
|
786
|
+
<span class='type'>(<tt>String</tt>)</span>
|
|
787
|
+
|
|
788
|
+
|
|
789
|
+
|
|
790
|
+
—
|
|
791
|
+
<div class='inline'>
|
|
792
|
+
<p>RTF string.</p>
|
|
793
|
+
</div>
|
|
794
|
+
|
|
795
|
+
</li>
|
|
796
|
+
|
|
797
|
+
</ul>
|
|
798
|
+
<p class="tag_title">Since:</p>
|
|
799
|
+
<ul class="since">
|
|
800
|
+
|
|
801
|
+
<li>
|
|
802
|
+
|
|
803
|
+
|
|
804
|
+
|
|
805
|
+
|
|
806
|
+
|
|
807
|
+
<div class='inline'>
|
|
808
|
+
<p>1.0.0</p>
|
|
809
|
+
</div>
|
|
810
|
+
|
|
811
|
+
</li>
|
|
812
|
+
|
|
813
|
+
</ul>
|
|
814
|
+
|
|
815
|
+
</div><table class="source_code">
|
|
816
|
+
<tr>
|
|
817
|
+
<td>
|
|
818
|
+
<pre class="lines">
|
|
819
|
+
|
|
820
|
+
|
|
821
|
+
959
|
|
822
|
+
960
|
|
823
|
+
961
|
|
824
|
+
962
|
|
825
|
+
963
|
|
826
|
+
964
|
|
827
|
+
965
|
|
828
|
+
966
|
|
829
|
+
967
|
|
830
|
+
968
|
|
831
|
+
969
|
|
832
|
+
970
|
|
833
|
+
971</pre>
|
|
834
|
+
</td>
|
|
835
|
+
<td>
|
|
836
|
+
<pre class="code"><span class="info file"># File 'lib/rrtf/formatting.rb', line 959</span>
|
|
837
|
+
|
|
838
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_page_formatting_to_rtf'>page_formatting_to_rtf</span>
|
|
839
|
+
<span class='id identifier rubyid_text'>text</span> <span class='op'>=</span> <span class='const'>StringIO</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span>
|
|
840
|
+
|
|
841
|
+
<span class='comment'># accumulate RTF representations of page attributes
|
|
842
|
+
</span> <span class='const'><span class='object_link'><a href="#PAGE_ATTRIBUTES-constant" title="RRTF::PageFormatting::PAGE_ATTRIBUTES (constant)">PAGE_ATTRIBUTES</a></span></span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_key'>key</span><span class='comma'>,</span> <span class='id identifier rubyid_options'>options</span><span class='op'>|</span>
|
|
843
|
+
<span class='kw'>if</span> <span class='id identifier rubyid_options'>options</span><span class='period'>.</span><span class='id identifier rubyid_has_key?'>has_key?</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>to_rtf</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
|
|
844
|
+
<span class='id identifier rubyid_rtf'>rtf</span> <span class='op'>=</span> <span class='id identifier rubyid_options'>options</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>to_rtf</span><span class='tstring_end'>"</span></span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_call'>call</span><span class='lparen'>(</span><span class='id identifier rubyid_send'>send</span><span class='lparen'>(</span><span class='id identifier rubyid_key'>key</span><span class='rparen'>)</span><span class='rparen'>)</span>
|
|
845
|
+
<span class='id identifier rubyid_text'>text</span> <span class='op'><<</span> <span class='id identifier rubyid_rtf'>rtf</span> <span class='kw'>unless</span> <span class='id identifier rubyid_rtf'>rtf</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span>
|
|
846
|
+
<span class='kw'>end</span> <span class='comment'># if
|
|
847
|
+
</span> <span class='kw'>end</span> <span class='comment'># each
|
|
848
|
+
</span>
|
|
849
|
+
<span class='id identifier rubyid_text'>text</span><span class='period'>.</span><span class='id identifier rubyid_string'>string</span>
|
|
850
|
+
<span class='kw'>end</span></pre>
|
|
851
|
+
</td>
|
|
852
|
+
</tr>
|
|
853
|
+
</table>
|
|
854
|
+
</div>
|
|
855
|
+
|
|
856
|
+
<div class="method_details ">
|
|
857
|
+
<h3 class="signature " id="set_page_formatting_from_hashmap-instance_method">
|
|
858
|
+
|
|
859
|
+
#<strong>set_page_formatting_from_hashmap</strong>(hash) ⇒ <tt>Object</tt>
|
|
860
|
+
|
|
861
|
+
|
|
862
|
+
|
|
863
|
+
|
|
864
|
+
|
|
865
|
+
</h3><div class="docstring">
|
|
866
|
+
<div class="discussion">
|
|
867
|
+
|
|
868
|
+
<p>Sets document formatting attributes according to the supplied hashmap.</p>
|
|
869
|
+
|
|
870
|
+
|
|
871
|
+
</div>
|
|
872
|
+
</div>
|
|
873
|
+
<div class="tags">
|
|
874
|
+
|
|
875
|
+
|
|
876
|
+
<p class="tag_title">See Also:</p>
|
|
877
|
+
<ul class="see">
|
|
878
|
+
|
|
879
|
+
<li><span class='object_link'><a href="#initialize_page_formatting-instance_method" title="RRTF::PageFormatting#initialize_page_formatting (method)">#initialize_page_formatting</a></span></li>
|
|
880
|
+
|
|
881
|
+
</ul>
|
|
882
|
+
<p class="tag_title">Since:</p>
|
|
883
|
+
<ul class="since">
|
|
884
|
+
|
|
885
|
+
<li>
|
|
886
|
+
|
|
887
|
+
|
|
888
|
+
|
|
889
|
+
|
|
890
|
+
|
|
891
|
+
<div class='inline'>
|
|
892
|
+
<p>1.0.0</p>
|
|
893
|
+
</div>
|
|
894
|
+
|
|
895
|
+
</li>
|
|
896
|
+
|
|
897
|
+
</ul>
|
|
898
|
+
|
|
899
|
+
</div><table class="source_code">
|
|
900
|
+
<tr>
|
|
901
|
+
<td>
|
|
902
|
+
<pre class="lines">
|
|
903
|
+
|
|
904
|
+
|
|
905
|
+
941
|
|
906
|
+
942
|
|
907
|
+
943
|
|
908
|
+
944
|
|
909
|
+
945
|
|
910
|
+
946
|
|
911
|
+
947
|
|
912
|
+
948
|
|
913
|
+
949
|
|
914
|
+
950
|
|
915
|
+
951
|
|
916
|
+
952
|
|
917
|
+
953
|
|
918
|
+
954</pre>
|
|
919
|
+
</td>
|
|
920
|
+
<td>
|
|
921
|
+
<pre class="code"><span class="info file"># File 'lib/rrtf/formatting.rb', line 941</span>
|
|
922
|
+
|
|
923
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_set_page_formatting_from_hashmap'>set_page_formatting_from_hashmap</span><span class='lparen'>(</span><span class='id identifier rubyid_hash'>hash</span><span class='rparen'>)</span>
|
|
924
|
+
<span class='id identifier rubyid_hash'>hash</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_attribute'>attribute</span><span class='comma'>,</span> <span class='id identifier rubyid_value'>value</span><span class='op'>|</span>
|
|
925
|
+
<span class='comment'># skip unreconized attributes
|
|
926
|
+
</span> <span class='kw'>next</span> <span class='kw'>unless</span><span class='lparen'>(</span><span class='const'><span class='object_link'><a href="#PAGE_ATTRIBUTES-constant" title="RRTF::PageFormatting::PAGE_ATTRIBUTES (constant)">PAGE_ATTRIBUTES</a></span></span><span class='period'>.</span><span class='id identifier rubyid_keys'>keys</span><span class='period'>.</span><span class='id identifier rubyid_include?'>include?</span><span class='lparen'>(</span><span class='id identifier rubyid_attribute'>attribute</span><span class='rparen'>)</span><span class='rparen'>)</span>
|
|
927
|
+
<span class='comment'># preprocess value if nessesary
|
|
928
|
+
</span> <span class='kw'>if</span> <span class='const'><span class='object_link'><a href="#PAGE_ATTRIBUTES-constant" title="RRTF::PageFormatting::PAGE_ATTRIBUTES (constant)">PAGE_ATTRIBUTES</a></span></span><span class='lbracket'>[</span><span class='id identifier rubyid_attribute'>attribute</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_has_key?'>has_key?</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>from_user</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
|
|
929
|
+
<span class='id identifier rubyid_value'>value</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="#PAGE_ATTRIBUTES-constant" title="RRTF::PageFormatting::PAGE_ATTRIBUTES (constant)">PAGE_ATTRIBUTES</a></span></span><span class='lbracket'>[</span><span class='id identifier rubyid_attribute'>attribute</span><span class='rbracket'>]</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>from_user</span><span class='tstring_end'>"</span></span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_call'>call</span><span class='lparen'>(</span><span class='id identifier rubyid_value'>value</span><span class='rparen'>)</span>
|
|
930
|
+
<span class='kw'>elsif</span> <span class='const'><span class='object_link'><a href="#PAGE_ATTRIBUTES-constant" title="RRTF::PageFormatting::PAGE_ATTRIBUTES (constant)">PAGE_ATTRIBUTES</a></span></span><span class='lbracket'>[</span><span class='id identifier rubyid_attribute'>attribute</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_has_key?'>has_key?</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>dictionary</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span> <span class='op'>&&</span> <span class='id identifier rubyid_value'>value</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span><span class='lparen'>(</span><span class='const'>String</span><span class='rparen'>)</span>
|
|
931
|
+
<span class='id identifier rubyid_value'>value</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="#PAGE_ATTRIBUTES-constant" title="RRTF::PageFormatting::PAGE_ATTRIBUTES (constant)">PAGE_ATTRIBUTES</a></span></span><span class='lbracket'>[</span><span class='id identifier rubyid_attribute'>attribute</span><span class='rbracket'>]</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>dictionary</span><span class='tstring_end'>"</span></span><span class='rbracket'>]</span><span class='lbracket'>[</span><span class='id identifier rubyid_value'>value</span><span class='rbracket'>]</span>
|
|
932
|
+
<span class='kw'>end</span> <span class='comment'># if
|
|
933
|
+
</span> <span class='comment'># set attribute value
|
|
934
|
+
</span> <span class='id identifier rubyid_send'>send</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_attribute'>attribute</span><span class='embexpr_end'>}</span><span class='tstring_content'>=</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='id identifier rubyid_value'>value</span><span class='rparen'>)</span>
|
|
935
|
+
<span class='kw'>end</span> <span class='comment'># each
|
|
936
|
+
</span><span class='kw'>end</span></pre>
|
|
937
|
+
</td>
|
|
938
|
+
</tr>
|
|
939
|
+
</table>
|
|
940
|
+
</div>
|
|
941
|
+
|
|
942
|
+
</div>
|
|
943
|
+
|
|
944
|
+
</div>
|
|
945
|
+
|
|
946
|
+
<div id="footer">
|
|
947
|
+
Generated on Mon Jul 31 21:48:57 2017 by
|
|
948
|
+
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
|
949
|
+
0.9.9 (ruby-2.3.3).
|
|
950
|
+
</div>
|
|
951
|
+
|
|
952
|
+
</div>
|
|
953
|
+
</body>
|
|
954
|
+
</html>
|