rbpdf 1.19.7 → 1.19.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG +3 -0
- data/lib/rbpdf.rb +2 -2
- data/lib/rbpdf/version.rb +1 -1
- data/test/rbpdf_html_test.rb +25 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 66699792092231cda5c7ad0b1cfdd9f446425ae4
|
4
|
+
data.tar.gz: e53cb1abb783881253c801aab591dcf84ad74442
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7a90e8b5bb735b8bff2f390537965013ba33b57c7a086749ed00383b1715437c6ee78b9833a783ee56c3f9f9d58c347a8193ea8f6f403eed6b847e8e2fc395c0
|
7
|
+
data.tar.gz: 46eb59da195f4f177b6ec7f3a33158543ae92d1e1f7e1d99e17d7c668e705ae8a93acaf174d4c3fb42b858267dfde6961dd30c7bd21afc25b2ae8866ef087dce
|
data/CHANGELOG
CHANGED
data/lib/rbpdf.rb
CHANGED
@@ -12351,7 +12351,7 @@ public
|
|
12351
12351
|
no = 0 # spaces without trim
|
12352
12352
|
ns = 0 # spaces with trim
|
12353
12353
|
|
12354
|
-
pmidtemp = pmid
|
12354
|
+
pmidtemp = pmid.dup
|
12355
12355
|
# escape special characters
|
12356
12356
|
pmidtemp.gsub!(/[\\][\(]/x, '\\#!#OP#!#')
|
12357
12357
|
pmidtemp.gsub!(/[\\][\)]/x, '\\#!#CP#!#')
|
@@ -12527,7 +12527,7 @@ public
|
|
12527
12527
|
if (@current_font['type'] == 'TrueTypeUnicode') or (@current_font['type'] == 'cidfont0')
|
12528
12528
|
# multibyte characters
|
12529
12529
|
spacew = spacewidthu
|
12530
|
-
pmidtemp = pmid
|
12530
|
+
pmidtemp = pmid.dup
|
12531
12531
|
# escape special characters
|
12532
12532
|
pmidtemp.gsub!(/[\\][\(]/x, '\\#!#OP#!#')
|
12533
12533
|
pmidtemp.gsub!(/[\\][\)]/x, '\\#!#CP#!#')
|
data/lib/rbpdf/version.rb
CHANGED
data/test/rbpdf_html_test.rb
CHANGED
@@ -403,6 +403,31 @@ class RbpdfHtmlTest < Test::Unit::TestCase
|
|
403
403
|
assert_equal 1, count_text
|
404
404
|
end
|
405
405
|
|
406
|
+
test "write_html Justify text test" do
|
407
|
+
pdf = MYPDF.new
|
408
|
+
pdf.set_font('times', 'BI', 20)
|
409
|
+
pdf.add_page()
|
410
|
+
|
411
|
+
text = 'hello Ruby (inside hello world) hello Ruby (inside hello world) hello Ruby (inside hello world)'
|
412
|
+
justify_text = 'hello Ruby \(inside hello world\) hello Ruby \(inside hello world\)'
|
413
|
+
htmlcontent = '<div style="text-align:justify;">' + text + '</div>'
|
414
|
+
|
415
|
+
pdf.write_html(htmlcontent, true, 0, true, 0)
|
416
|
+
|
417
|
+
page = pdf.get_page
|
418
|
+
assert_equal 1, page
|
419
|
+
|
420
|
+
content = []
|
421
|
+
contents = pdf.getPageBuffer(1)
|
422
|
+
contents.each_line {|line| content.push line.chomp if line.include? ' TJ ET' } # Text Line set
|
423
|
+
|
424
|
+
count_text = 0
|
425
|
+
content.each do |line|
|
426
|
+
count_text += 1 unless line.scan(justify_text).empty?
|
427
|
+
end
|
428
|
+
assert_equal 1, count_text, "'#{justify_text}' is not include in '#{content.inspect}'"
|
429
|
+
end
|
430
|
+
|
406
431
|
test "write_html Non ASCII text test" do
|
407
432
|
pdf = MYPDF.new
|
408
433
|
pdf.add_page()
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rbpdf
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.19.
|
4
|
+
version: 1.19.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- NAITOH Jun
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-01-
|
11
|
+
date: 2019-01-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: htmlentities
|