hexapdf 1.9.0 → 1.9.1
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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +8 -0
- data/lib/hexapdf/content/processor.rb +14 -0
- data/lib/hexapdf/version.rb +1 -1
- data/test/hexapdf/content/test_processor.rb +17 -0
- metadata +3 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: e272dafd41bb732e5110aadc794399a3e5d9823571de2ee67f119f05422af9ac
|
|
4
|
+
data.tar.gz: 1269ed888e0b5c3fac4b4a25afbcdab75835252aadaf46fe6a92cfbde379f330
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 69f36a31e49cb7b434bc53e63c2fde4c271a506046224a0dbb76b473176f435d618d0e9de90a64f3b95c4fa64cec8a8addbcb4c5c997ac9790fd79bd46093306
|
|
7
|
+
data.tar.gz: 786835f800b29263364d97c872465b7fcaf431bf846a793a3fe502810090bc6ce1b94089a18f2787ed5cc3e9b982cf0a2d33db68b7812861f938e4f209af17d4
|
data/CHANGELOG.md
CHANGED
|
@@ -75,6 +75,8 @@ module HexaPDF
|
|
|
75
75
|
# provided. Both can directly be invoked from the 'show_text' and 'show_text_with_positioning'
|
|
76
76
|
# methods.
|
|
77
77
|
#
|
|
78
|
+
# There is a default implementation of 'move_text_next_line_and_show_text' and
|
|
79
|
+
# 'set_spacing_move_text_next_line_and_show_text' that just defers to 'show_text'.
|
|
78
80
|
class Processor
|
|
79
81
|
|
|
80
82
|
# Represents an (immutable) glyph box with positioning information.
|
|
@@ -365,6 +367,18 @@ module HexaPDF
|
|
|
365
367
|
|
|
366
368
|
protected
|
|
367
369
|
|
|
370
|
+
# Provides a default implementation for the ' operator which just invokes #show_text if it is
|
|
371
|
+
# available. All other processing is already done by the operator implementation.
|
|
372
|
+
def move_text_next_line_and_show_text(text)
|
|
373
|
+
show_text(text) if respond_to?(:show_text, true)
|
|
374
|
+
end
|
|
375
|
+
|
|
376
|
+
# Provides a default implementation for the " operator which just invokes #show_text if it is
|
|
377
|
+
# available. All other processing is already done by the operator implementation.
|
|
378
|
+
def set_spacing_move_text_next_line_and_show_text(_word_space, _char_space, text)
|
|
379
|
+
show_text(text) if respond_to?(:show_text, true)
|
|
380
|
+
end
|
|
381
|
+
|
|
368
382
|
# Provides a default implementation for the 'Do' operator.
|
|
369
383
|
#
|
|
370
384
|
# It checks if the XObject is a Form XObject and if so, processes the contents of the Form
|
data/lib/hexapdf/version.rb
CHANGED
|
@@ -87,6 +87,23 @@ describe HexaPDF::Content::Processor do
|
|
|
87
87
|
end
|
|
88
88
|
end
|
|
89
89
|
|
|
90
|
+
describe "(set_spacing_)move_text_next_line_and_show_text" do
|
|
91
|
+
it "invokes show_text if it exists" do
|
|
92
|
+
@processor.process(:BT)
|
|
93
|
+
|
|
94
|
+
# nothing should happen here as no show_text is yet defined
|
|
95
|
+
@processor.process(:"'", ['Text'])
|
|
96
|
+
@processor.process(:'"', [10, 5, 'Text'])
|
|
97
|
+
|
|
98
|
+
value = nil
|
|
99
|
+
@processor.define_singleton_method(:show_text) {|text| value = text }
|
|
100
|
+
@processor.process(:"'", ['Text1'])
|
|
101
|
+
assert_equal('Text1', value)
|
|
102
|
+
@processor.process(:'"', [10, 5, 'Text2'])
|
|
103
|
+
assert_equal('Text2', value)
|
|
104
|
+
end
|
|
105
|
+
end
|
|
106
|
+
|
|
90
107
|
describe "paint_xobject" do
|
|
91
108
|
it "processes the contents of a Form xobject" do
|
|
92
109
|
test_case = self
|
metadata
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: hexapdf
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.9.
|
|
4
|
+
version: 1.9.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Thomas Leitner
|
|
8
8
|
bindir: bin
|
|
9
9
|
cert_chain: []
|
|
10
|
-
date:
|
|
10
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
|
11
11
|
dependencies:
|
|
12
12
|
- !ruby/object:Gem::Dependency
|
|
13
13
|
name: cmdparse
|
|
@@ -925,7 +925,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
925
925
|
- !ruby/object:Gem::Version
|
|
926
926
|
version: '0'
|
|
927
927
|
requirements: []
|
|
928
|
-
rubygems_version:
|
|
928
|
+
rubygems_version: 4.0.3
|
|
929
929
|
specification_version: 4
|
|
930
930
|
summary: HexaPDF - A Versatile PDF Creation and Manipulation Library For Ruby
|
|
931
931
|
test_files: []
|