obf 0.9.8.25 → 0.9.8.26
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/obf/pdf.rb +20 -14
- 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: 9305e71e25cff6673755ff1504e3471e74db6ee5a51c1a683f360e129bccd982
|
4
|
+
data.tar.gz: 416df51ca314f38b07c572591dd6d2e0a98004c2811a8320a84d6110bfedcb20
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 349cfd3f96c6aee6c63a1700376581b0bd8b4d26875fd544025fe7f9f7599766fcf31d85bae658b51a834ced331e9f83eb6d3a4122ce6a614fedc1063558a66c
|
7
|
+
data.tar.gz: 4ac9882db28ce1a20ff48380cf8df008bed4ba0e1feadfbfc3aa28ba22d52a412f92c736c444bddbe5cd7377dc774b6b22a9ab15be7739db4cf1a6aa2d32a8f0
|
data/lib/obf/pdf.rb
CHANGED
@@ -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
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
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 =>
|
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
|