You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+27-19Lines changed: 27 additions & 19 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,7 +5,8 @@ Gem for generating .odt files by making strings, images, tables and sections rep
5
5
6
6
### NEW
7
7
8
-
* uses newer rubyzip >= **1.3.0**
8
+
* allow nested images inside tables and sections
9
+
* allow sections inside tables
9
10
10
11
## INSTALL
11
12
@@ -28,7 +29,7 @@ There are *four* kinds of substitutions available:
28
29
29
30
#### Fields
30
31
31
-
It's just an upcase sentence, surrounded by brackets. It will be replaced for wathever value you supply.
32
+
It's just an upcase sentence, surrounded by brackets. It will be replaced by the value you supply.
32
33
33
34
In the folowing example:
34
35
@@ -79,21 +80,7 @@ and a collection `@list_of_itens`, it will create one row for each item in the c
79
80
80
81
Any format applied to the fields in the template will be preserved.
81
82
82
-
83
-
### Images
84
-
85
-
You must put a mock image in your `.odt` template and give it a name. That name will be used to replace the mock image for the actual image.
86
-
You can also assign any properties you want to the mock image and they will be kept once the image is replaced.
87
-
88
-
An image replace would look like this:
89
-
90
-
```ruby
91
-
report =ODFReport::Report.new("my_template.odt") do |r|
92
-
r.add_image :graphic1, "/path/to/the/image.jpg"
93
-
end
94
-
```
95
-
96
-
### Sections
83
+
#### Sections
97
84
98
85
Sometimes, you have to repeat a whole chunk of a document, in a structure a lot more complex than a table. You can make a Section in your template and use it in this situations. Creating a Section in OpenOffice is as easy as select menu *Insert* and then *Section...*, and then choose a name for it.
99
86
@@ -146,6 +133,26 @@ Note that when you add a Table to a Section, you don't pass the collection itsel
146
133
147
134
In the above example, `s.add_table("TB_ITEMS", :items, header: true) do |t|`, the `:items` thing refers to a `invoice.items`. Easy, right?
148
135
136
+
137
+
#### Images
138
+
139
+
You must put a mock image in your `.odt` template and give it a name. That name will be used to replace the mock image for the actual image.
140
+
You can also assign any properties you want to the mock image and they will be kept once the image is replaced.
141
+
142
+
An image replace would look like this:
143
+
144
+
```ruby
145
+
report =ODFReport::Report.new("my_template.odt") do |r|
0 commit comments