podoff 1.2.3 → 1.2.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +6 -1
- data/README.md +13 -0
- data/lib/podoff.rb +3 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 01c13867339ca5cedc0ff2682a70a94686aa04a1fc642fa9479d491accdc93fc
|
4
|
+
data.tar.gz: e340f680e7c5c76d783b09abdb1872707a6fca4b4ba972ccb882aed1b82ff2a8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8445ecd4ba92939e54662f32144cfedb3796b21c197db2a4efdf5f36925851c02a82eaa76a502f5b135ddc016a2f98559bd361a96f196fd531957b812d9406b0
|
7
|
+
data.tar.gz: 5c19354e0060eacbcf9402972ed3e7d3eeaf3db264d87c894484fb8105128212495a7283c2e675032db99db04e389cbba526fc775670a1934519a662bddb0809
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -112,6 +112,7 @@ module MyApp::Pdf
|
|
112
112
|
st = d.add_stream # open stream...
|
113
113
|
|
114
114
|
st.font 'MyHelv', 12 # font is an alias to tf
|
115
|
+
st.color 0, 0, 0 # rgb black
|
115
116
|
st.text 100, 100, data['customer_name']
|
116
117
|
st.text 100, 80, data['customer_phone']
|
117
118
|
st.text 100, 60, data['date'] if data['date']
|
@@ -140,11 +141,13 @@ module Podoff # adding a few helper methods to the podoff classes
|
|
140
141
|
|
141
142
|
fo0 = add_base_font('/Helvetica')
|
142
143
|
fo1 = add_base_font('/ZapfDingbats')
|
144
|
+
fo2 = add_base_font('/Courier')
|
143
145
|
|
144
146
|
pages.each { |pa|
|
145
147
|
pa = re_add(pa)
|
146
148
|
pa.insert_font('/MyHelv', fo0)
|
147
149
|
pa.insert_font('/MyZapf', fo1)
|
150
|
+
pa.insert_font('/MyMono', fo2)
|
148
151
|
}
|
149
152
|
end
|
150
153
|
end
|
@@ -239,9 +242,19 @@ TODO
|
|
239
242
|
```ruby
|
240
243
|
class Podoff::Stream
|
241
244
|
|
245
|
+
# set the current font and font size for the stream
|
246
|
+
#
|
242
247
|
def tf(font_name, font_size)
|
243
248
|
alias :font :tf
|
244
249
|
|
250
|
+
# set the current color for the stream
|
251
|
+
#
|
252
|
+
def rg(red, green, blue)
|
253
|
+
alias :rgb :rg
|
254
|
+
alias :color :rg
|
255
|
+
|
256
|
+
# write a piece of text at a given position
|
257
|
+
#
|
245
258
|
def bt(x, y, text)
|
246
259
|
alias :text :bt
|
247
260
|
```
|
data/lib/podoff.rb
CHANGED
@@ -6,7 +6,7 @@ require 'stringio'
|
|
6
6
|
|
7
7
|
module Podoff
|
8
8
|
|
9
|
-
VERSION = '1.2.
|
9
|
+
VERSION = '1.2.4'
|
10
10
|
|
11
11
|
def self.load(path, encoding)
|
12
12
|
|
@@ -520,6 +520,8 @@ module Podoff
|
|
520
520
|
|
521
521
|
def bt(x, y, text)
|
522
522
|
|
523
|
+
return unless text
|
524
|
+
|
523
525
|
@content.write "\n" if @content.size > 0
|
524
526
|
@content.write "BT "
|
525
527
|
@content.write @font if @font
|