obf 0.9.8.25 → 0.9.8.26

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.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/obf/pdf.rb +20 -14
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e6add0691a31359799dec36bf6c6e8233b853bd89a34395581a117be36a09051
4
- data.tar.gz: a3092d682f7e92f8b3718df3101b4c75c90747f720ff75779f12da36cce3b635
3
+ metadata.gz: 9305e71e25cff6673755ff1504e3471e74db6ee5a51c1a683f360e129bccd982
4
+ data.tar.gz: 416df51ca314f38b07c572591dd6d2e0a98004c2811a8320a84d6110bfedcb20
5
5
  SHA512:
6
- metadata.gz: 505f71a0513920346010ffc1195d1b50f6667098cf85775f274f594801f9785562cac336652e1eeb980354d1eb0ec49e368ae99612b16f015b7bd2cb879d27b0
7
- data.tar.gz: 8a1df87595566010257673eecc64e88a741814bfe833d7a21f21e36728a6296ed322c2fac99875f7a210bd44d76227a54a55ecaf7a09e39bf6e715e9ab283bdc
6
+ metadata.gz: 349cfd3f96c6aee6c63a1700376581b0bd8b4d26875fd544025fe7f9f7599766fcf31d85bae658b51a834ced331e9f83eb6d3a4122ce6a614fedc1063558a66c
7
+ data.tar.gz: 4ac9882db28ce1a20ff48380cf8df008bed4ba0e1feadfbfc3aa28ba22d52a412f92c736c444bddbe5cd7377dc774b6b22a9ab15be7739db4cf1a6aa2d32a8f0
@@ -78,6 +78,7 @@ module OBF::PDF
78
78
  end
79
79
  end
80
80
  end
81
+ OBF::Utils.log "backlinks #{obj['backlinks'].to_json}"
81
82
  end
82
83
  obj['boards'].each_with_index do |board, idx|
83
84
  started = Time.now.to_i
@@ -175,20 +176,24 @@ module OBF::PDF
175
176
  pdf.fill_color "eeeeee"
176
177
  pdf.stroke_color "888888"
177
178
 
178
- include_back = options['pages'] && page_num != 1
179
+ include_back = options['pages'] && page_num != 1 && page_num != 0
179
180
  # Go Back
180
181
  if include_back
181
- x = 110
182
- pdf.fill_and_stroke_rounded_rectangle [x, header_height], 100, header_height, default_radius
183
- pdf.fill_color "6D81D1"
184
- pdf.fill_and_stroke_polygon([x + 5, 45], [x + 35, 70], [x + 35, 60], [x + 95, 60], [x + 95, 30], [x + 35, 30], [x + 35, 20])
185
- pdf.fill_color "666666"
186
- text_options = {:text => "Go Back"}
187
- text_options[:anchor] = "page1" if options['links']
188
- pdf.formatted_text_box [text_options], :at => [x + 10, header_height], :width => 80, :height => 80, :align => :center, :valign => :bottom, :overflow => :shrink_to_fit
189
- backlinks = (options['backlinks'] || []).length > 0 ? options['backlinks'].join(',') : '1'
190
- pdf.fill_color "ffffff"
191
- pdf.formatted_text_box [{:text => backlinks}], :at => [x + 10, header_height + 5], :width => 80, :height => 80, :align => :center, :valign => :center, :overflow => :shrink_to_fit
182
+ OBF::Utils.log " board backlinks #{obj['id']} #{options['backlinks'].to_json}"
183
+ options['backlinks'] ||= []
184
+ if options['backlinks'].length > 0
185
+ x = 110
186
+ pdf.fill_and_stroke_rounded_rectangle [x, header_height], 100, header_height, default_radius
187
+ pdf.fill_color "6D81D1"
188
+ pdf.fill_and_stroke_polygon([x + 5, 45], [x + 35, 70], [x + 35, 60], [x + 95, 60], [x + 95, 30], [x + 35, 30], [x + 35, 20])
189
+ pdf.fill_color "666666"
190
+ text_options = {:text => "Go Back"}
191
+ text_options[:anchor] = "page1" if options['links']
192
+ pdf.formatted_text_box [text_options], :at => [x + 10, header_height], :width => 80, :height => 80, :align => :center, :valign => :bottom, :overflow => :shrink_to_fit
193
+ backlinks = (options['backlinks'] || []).join(',')
194
+ pdf.fill_color "ffffff"
195
+ pdf.formatted_text_box [{:text => backlinks}], :at => [x + 10, header_height + 5], :width => 80, :height => 80, :align => :center, :valign => :center, :overflow => :shrink_to_fit
196
+ end
192
197
  end
193
198
 
194
199
  # Say it Out Loud
@@ -428,14 +433,15 @@ module OBF::PDF
428
433
  # footer
429
434
  pdf.fill_color "bbbbbb"
430
435
  obj['name'] = nil if obj['name'] == 'Unnamed Board'
436
+ pdf.font('Times-Roman')
431
437
  if OBF::PDF.footer_text || obj['name']
432
438
  text = [obj['name'], OBF::PDF.footer_text].compact.join(', ')
433
439
  offset = options['pages'] ? 400 : 300
434
440
  pdf.formatted_text_box [{:text => text, :link => OBF::PDF.footer_url}], :at => [doc_width - offset, text_height], :width => 300, :height => text_height, :align => :right, :valign => :center, :overflow => :shrink_to_fit
435
441
  end
436
442
  pdf.fill_color "000000"
437
- if options['pages']
438
- text_options = {:text => options['pages'][obj['id']]}
443
+ if options['pages'] && page_num != 0
444
+ text_options = {:text => page_num.to_s}
439
445
  text_options[:anchor] = "page1" if options['links']
440
446
  pdf.formatted_text_box [text_options], :at => [doc_width - 100, text_height], :width => 100, :height => text_height, :align => :right, :valign => :center, :overflow => :shrink_to_fit
441
447
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: obf
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.8.25
4
+ version: 0.9.8.26
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brian Whitmer