podoff 1.2.3 → 1.2.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (5) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +6 -1
  3. data/README.md +13 -0
  4. data/lib/podoff.rb +3 -1
  5. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 524a29d94dd28dc3718ba75fb4069ae48aaf92c9155354dd47bea3c0aac3da06
4
- data.tar.gz: 0eeb72d7886f515b4cc1fa506cb684b1dbc659f417968fa1384f46fa01f8ccd8
3
+ metadata.gz: 01c13867339ca5cedc0ff2682a70a94686aa04a1fc642fa9479d491accdc93fc
4
+ data.tar.gz: e340f680e7c5c76d783b09abdb1872707a6fca4b4ba972ccb882aed1b82ff2a8
5
5
  SHA512:
6
- metadata.gz: a6940fc4156ecc2065d69e9ed07e65e0fba7824992f4203d8c65079425739cc7fa76f0787f42c89512dfef19d7a3b8af1d399c5fb3d947358746c94ee74777b1
7
- data.tar.gz: 25a8c5f3be8f92241eb4596eb7b0896d222f11e786940b6c23dbe61062ef69b2f627426aa15c62b21f52d07a80ad828459e1ef7395d8f313054f3ce3dbdace15
6
+ metadata.gz: 8445ecd4ba92939e54662f32144cfedb3796b21c197db2a4efdf5f36925851c02a82eaa76a502f5b135ddc016a2f98559bd361a96f196fd531957b812d9406b0
7
+ data.tar.gz: 5c19354e0060eacbcf9402972ed3e7d3eeaf3db264d87c894484fb8105128212495a7283c2e675032db99db04e389cbba526fc775670a1934519a662bddb0809
@@ -1,5 +1,10 @@
1
1
 
2
- # podoff CHANGELOG.md
2
+ # CHANGELOG.md
3
+
4
+
5
+ ## podoff 1.2.4 released 2019-03-12
6
+
7
+ * Let Stream#bt/#text accept a nil string
3
8
 
4
9
 
5
10
  ## podoff 1.2.3 released 2019-03-12
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
  ```
@@ -6,7 +6,7 @@ require 'stringio'
6
6
 
7
7
  module Podoff
8
8
 
9
- VERSION = '1.2.3'
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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: podoff
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.3
4
+ version: 1.2.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - John Mettraux