pdf-wrapper 0.4.1 → 0.4.4
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.
- data/CHANGELOG +13 -0
- data/README.rdoc +8 -14
- data/Rakefile +6 -67
- data/lib/pdf/wrapper.rb +12 -1
- data/lib/pdf/wrapper/images.rb +0 -6
- data/lib/pdf/wrapper/text.rb +0 -3
- data/{specs → spec}/data/google.png +0 -0
- data/{specs → spec}/data/iso-2022-jp.txt +0 -0
- data/{specs → spec}/data/orc.svg +0 -0
- data/{specs → spec}/data/shift_jis.txt +0 -0
- data/{specs → spec}/data/shipsail.jpg +0 -0
- data/{specs → spec}/data/stef.jpg +0 -0
- data/{specs → spec}/data/utf8-long.pdf +0 -0
- data/{specs → spec}/data/utf8-long.txt +0 -0
- data/{specs → spec}/data/utf8.txt +0 -0
- data/{specs → spec}/data/windmill.jpg +0 -0
- data/{specs → spec}/data/zits.gif +0 -0
- data/{specs → spec}/graphics_spec.rb +13 -13
- data/{specs → spec}/image_spec.rb +6 -6
- data/{specs → spec}/spec_helper.rb +4 -10
- data/{specs → spec}/tables_spec.rb +32 -32
- data/{specs → spec}/text_spec.rb +23 -23
- data/{specs → spec}/wrapper_spec.rb +39 -39
- metadata +198 -29
- data/lib/pdf/wrapper/loading.rb +0 -64
- data/specs/load_spec.rb +0 -33
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pdf-wrapper
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 7
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 4
|
9
|
-
-
|
10
|
-
version: 0.4.
|
9
|
+
- 4
|
10
|
+
version: 0.4.4
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- James Healy
|
@@ -15,13 +15,72 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2010-
|
18
|
+
date: 2010-11-19 00:00:00 -05:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|
22
|
-
name:
|
22
|
+
name: rake
|
23
23
|
prerelease: false
|
24
24
|
requirement: &id001 !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
26
|
+
requirements:
|
27
|
+
- - ">="
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
hash: 3
|
30
|
+
segments:
|
31
|
+
- 0
|
32
|
+
version: "0"
|
33
|
+
type: :development
|
34
|
+
version_requirements: *id001
|
35
|
+
- !ruby/object:Gem::Dependency
|
36
|
+
name: roodi
|
37
|
+
prerelease: false
|
38
|
+
requirement: &id002 !ruby/object:Gem::Requirement
|
39
|
+
none: false
|
40
|
+
requirements:
|
41
|
+
- - ">="
|
42
|
+
- !ruby/object:Gem::Version
|
43
|
+
hash: 3
|
44
|
+
segments:
|
45
|
+
- 0
|
46
|
+
version: "0"
|
47
|
+
type: :development
|
48
|
+
version_requirements: *id002
|
49
|
+
- !ruby/object:Gem::Dependency
|
50
|
+
name: rspec
|
51
|
+
prerelease: false
|
52
|
+
requirement: &id003 !ruby/object:Gem::Requirement
|
53
|
+
none: false
|
54
|
+
requirements:
|
55
|
+
- - ~>
|
56
|
+
- !ruby/object:Gem::Version
|
57
|
+
hash: 1
|
58
|
+
segments:
|
59
|
+
- 2
|
60
|
+
- 1
|
61
|
+
version: "2.1"
|
62
|
+
type: :development
|
63
|
+
version_requirements: *id003
|
64
|
+
- !ruby/object:Gem::Dependency
|
65
|
+
name: pdf-reader
|
66
|
+
prerelease: false
|
67
|
+
requirement: &id004 !ruby/object:Gem::Requirement
|
68
|
+
none: false
|
69
|
+
requirements:
|
70
|
+
- - ~>
|
71
|
+
- !ruby/object:Gem::Version
|
72
|
+
hash: 51
|
73
|
+
segments:
|
74
|
+
- 0
|
75
|
+
- 8
|
76
|
+
- 6
|
77
|
+
version: 0.8.6
|
78
|
+
type: :development
|
79
|
+
version_requirements: *id004
|
80
|
+
- !ruby/object:Gem::Dependency
|
81
|
+
name: cairo
|
82
|
+
prerelease: false
|
83
|
+
requirement: &id005 !ruby/object:Gem::Requirement
|
25
84
|
none: false
|
26
85
|
requirements:
|
27
86
|
- - ~>
|
@@ -32,7 +91,103 @@ dependencies:
|
|
32
91
|
- 8
|
33
92
|
version: "1.8"
|
34
93
|
type: :runtime
|
35
|
-
version_requirements: *
|
94
|
+
version_requirements: *id005
|
95
|
+
- !ruby/object:Gem::Dependency
|
96
|
+
name: gtk2
|
97
|
+
prerelease: false
|
98
|
+
requirement: &id006 !ruby/object:Gem::Requirement
|
99
|
+
none: false
|
100
|
+
requirements:
|
101
|
+
- - ~>
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
hash: 381
|
104
|
+
segments:
|
105
|
+
- 0
|
106
|
+
- 90
|
107
|
+
- 5
|
108
|
+
version: 0.90.5
|
109
|
+
type: :runtime
|
110
|
+
version_requirements: *id006
|
111
|
+
- !ruby/object:Gem::Dependency
|
112
|
+
name: glib2
|
113
|
+
prerelease: false
|
114
|
+
requirement: &id007 !ruby/object:Gem::Requirement
|
115
|
+
none: false
|
116
|
+
requirements:
|
117
|
+
- - ~>
|
118
|
+
- !ruby/object:Gem::Version
|
119
|
+
hash: 381
|
120
|
+
segments:
|
121
|
+
- 0
|
122
|
+
- 90
|
123
|
+
- 5
|
124
|
+
version: 0.90.5
|
125
|
+
type: :runtime
|
126
|
+
version_requirements: *id007
|
127
|
+
- !ruby/object:Gem::Dependency
|
128
|
+
name: pango
|
129
|
+
prerelease: false
|
130
|
+
requirement: &id008 !ruby/object:Gem::Requirement
|
131
|
+
none: false
|
132
|
+
requirements:
|
133
|
+
- - ~>
|
134
|
+
- !ruby/object:Gem::Version
|
135
|
+
hash: 381
|
136
|
+
segments:
|
137
|
+
- 0
|
138
|
+
- 90
|
139
|
+
- 5
|
140
|
+
version: 0.90.5
|
141
|
+
type: :runtime
|
142
|
+
version_requirements: *id008
|
143
|
+
- !ruby/object:Gem::Dependency
|
144
|
+
name: poppler
|
145
|
+
prerelease: false
|
146
|
+
requirement: &id009 !ruby/object:Gem::Requirement
|
147
|
+
none: false
|
148
|
+
requirements:
|
149
|
+
- - ~>
|
150
|
+
- !ruby/object:Gem::Version
|
151
|
+
hash: 381
|
152
|
+
segments:
|
153
|
+
- 0
|
154
|
+
- 90
|
155
|
+
- 5
|
156
|
+
version: 0.90.5
|
157
|
+
type: :runtime
|
158
|
+
version_requirements: *id009
|
159
|
+
- !ruby/object:Gem::Dependency
|
160
|
+
name: gdk_pixbuf2
|
161
|
+
prerelease: false
|
162
|
+
requirement: &id010 !ruby/object:Gem::Requirement
|
163
|
+
none: false
|
164
|
+
requirements:
|
165
|
+
- - ~>
|
166
|
+
- !ruby/object:Gem::Version
|
167
|
+
hash: 381
|
168
|
+
segments:
|
169
|
+
- 0
|
170
|
+
- 90
|
171
|
+
- 5
|
172
|
+
version: 0.90.5
|
173
|
+
type: :runtime
|
174
|
+
version_requirements: *id010
|
175
|
+
- !ruby/object:Gem::Dependency
|
176
|
+
name: rsvg2
|
177
|
+
prerelease: false
|
178
|
+
requirement: &id011 !ruby/object:Gem::Requirement
|
179
|
+
none: false
|
180
|
+
requirements:
|
181
|
+
- - ~>
|
182
|
+
- !ruby/object:Gem::Version
|
183
|
+
hash: 381
|
184
|
+
segments:
|
185
|
+
- 0
|
186
|
+
- 90
|
187
|
+
- 5
|
188
|
+
version: 0.90.5
|
189
|
+
type: :runtime
|
190
|
+
version_requirements: *id011
|
36
191
|
description: A unicode aware PDF writing library that uses the ruby bindings to various c libraries ( like cairo, pango, poppler and rsvg ) to do the heavy lifting.
|
37
192
|
email: jimmy@deefa.com
|
38
193
|
executables: []
|
@@ -61,7 +216,6 @@ files:
|
|
61
216
|
- lib/pdf/errors.rb
|
62
217
|
- lib/pdf/wrapper/graphics.rb
|
63
218
|
- lib/pdf/wrapper/table.rb
|
64
|
-
- lib/pdf/wrapper/loading.rb
|
65
219
|
- lib/pdf/wrapper/text_image_cell.rb
|
66
220
|
- lib/pdf/wrapper/images.rb
|
67
221
|
- lib/pdf/wrapper/text.rb
|
@@ -69,30 +223,29 @@ files:
|
|
69
223
|
- lib/pdf/wrapper/text_cell.rb
|
70
224
|
- lib/pdf/core.rb
|
71
225
|
- lib/pdf/wrapper.rb
|
72
|
-
- specs/wrapper_spec.rb
|
73
|
-
- specs/image_spec.rb
|
74
|
-
- specs/graphics_spec.rb
|
75
|
-
- specs/data/google.png
|
76
|
-
- specs/data/zits.gif
|
77
|
-
- specs/data/windmill.jpg
|
78
|
-
- specs/data/utf8-long.txt
|
79
|
-
- specs/data/shift_jis.txt
|
80
|
-
- specs/data/orc.svg
|
81
|
-
- specs/data/shipsail.jpg
|
82
|
-
- specs/data/stef.jpg
|
83
|
-
- specs/data/iso-2022-jp.txt
|
84
|
-
- specs/data/utf8.txt
|
85
|
-
- specs/data/utf8-long.pdf
|
86
|
-
- specs/spec_helper.rb
|
87
|
-
- specs/tables_spec.rb
|
88
|
-
- specs/load_spec.rb
|
89
|
-
- specs/text_spec.rb
|
90
226
|
- Rakefile
|
91
227
|
- README.rdoc
|
92
228
|
- CHANGELOG
|
93
229
|
- TODO
|
230
|
+
- spec/wrapper_spec.rb
|
231
|
+
- spec/image_spec.rb
|
232
|
+
- spec/graphics_spec.rb
|
233
|
+
- spec/data/google.png
|
234
|
+
- spec/data/zits.gif
|
235
|
+
- spec/data/windmill.jpg
|
236
|
+
- spec/data/utf8-long.txt
|
237
|
+
- spec/data/shift_jis.txt
|
238
|
+
- spec/data/orc.svg
|
239
|
+
- spec/data/shipsail.jpg
|
240
|
+
- spec/data/stef.jpg
|
241
|
+
- spec/data/iso-2022-jp.txt
|
242
|
+
- spec/data/utf8.txt
|
243
|
+
- spec/data/utf8-long.pdf
|
244
|
+
- spec/spec_helper.rb
|
245
|
+
- spec/tables_spec.rb
|
246
|
+
- spec/text_spec.rb
|
94
247
|
has_rdoc: true
|
95
|
-
homepage:
|
248
|
+
homepage: https://github.com/yob/pdf-wrapper
|
96
249
|
licenses: []
|
97
250
|
|
98
251
|
post_install_message:
|
@@ -124,10 +277,26 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
124
277
|
version: "0"
|
125
278
|
requirements: []
|
126
279
|
|
127
|
-
rubyforge_project:
|
280
|
+
rubyforge_project:
|
128
281
|
rubygems_version: 1.3.7
|
129
282
|
signing_key:
|
130
283
|
specification_version: 3
|
131
284
|
summary: A PDF generating library built on top of cairo
|
132
|
-
test_files:
|
133
|
-
|
285
|
+
test_files:
|
286
|
+
- spec/wrapper_spec.rb
|
287
|
+
- spec/image_spec.rb
|
288
|
+
- spec/graphics_spec.rb
|
289
|
+
- spec/data/google.png
|
290
|
+
- spec/data/zits.gif
|
291
|
+
- spec/data/windmill.jpg
|
292
|
+
- spec/data/utf8-long.txt
|
293
|
+
- spec/data/shift_jis.txt
|
294
|
+
- spec/data/orc.svg
|
295
|
+
- spec/data/shipsail.jpg
|
296
|
+
- spec/data/stef.jpg
|
297
|
+
- spec/data/iso-2022-jp.txt
|
298
|
+
- spec/data/utf8.txt
|
299
|
+
- spec/data/utf8-long.pdf
|
300
|
+
- spec/spec_helper.rb
|
301
|
+
- spec/tables_spec.rb
|
302
|
+
- spec/text_spec.rb
|
data/lib/pdf/wrapper/loading.rb
DELETED
@@ -1,64 +0,0 @@
|
|
1
|
-
module PDF
|
2
|
-
class Wrapper
|
3
|
-
# load libpango if it isn't already loaded.
|
4
|
-
# This will add some methods to the cairo Context class in addition to providing
|
5
|
-
# its own classes and constants. A small amount of documentation is available at
|
6
|
-
# http://ruby-gnome2.sourceforge.jp/fr/hiki.cgi?Cairo%3A%3AContext#Pango+related+APIs
|
7
|
-
def load_libpango
|
8
|
-
return if @context.respond_to? :create_pango_layout
|
9
|
-
|
10
|
-
begin
|
11
|
-
require 'pango'
|
12
|
-
rescue LoadError
|
13
|
-
raise LoadError, 'Ruby/Pango library not found. Visit http://ruby-gnome2.sourceforge.jp/'
|
14
|
-
end
|
15
|
-
end
|
16
|
-
|
17
|
-
# load lib gdkpixbuf if it isn't already loaded.
|
18
|
-
# This will add some methods to the cairo Context class in addition to providing
|
19
|
-
# its own classes and constants.
|
20
|
-
def load_libpixbuf
|
21
|
-
return if @context.respond_to? :set_source_pixbuf
|
22
|
-
|
23
|
-
begin
|
24
|
-
require 'gdk_pixbuf2'
|
25
|
-
rescue LoadError
|
26
|
-
raise LoadError, 'Ruby/GdkPixbuf library not found. Visit http://ruby-gnome2.sourceforge.jp/'
|
27
|
-
end
|
28
|
-
end
|
29
|
-
|
30
|
-
# load lib poppler if it isn't already loaded.
|
31
|
-
# This will add some methods to the cairo Context class in addition to providing
|
32
|
-
# its own classes and constants.
|
33
|
-
def load_libpoppler
|
34
|
-
return if @context.respond_to? :render_poppler_page
|
35
|
-
|
36
|
-
begin
|
37
|
-
require 'gtk2'
|
38
|
-
rescue Gtk::InitError
|
39
|
-
# ignore this error, it's thrown when gtk2 is loaded with no xsession available.
|
40
|
-
# as advised at http://www.ruby-forum.com/topic/182949
|
41
|
-
end
|
42
|
-
begin
|
43
|
-
require 'poppler'
|
44
|
-
rescue LoadError
|
45
|
-
raise LoadError, 'Ruby/Poppler library not found. Visit http://ruby-gnome2.sourceforge.jp/'
|
46
|
-
end
|
47
|
-
end
|
48
|
-
|
49
|
-
# load librsvg if it isn't already loaded
|
50
|
-
# This will add an additional method to the Cairo::Context class
|
51
|
-
# that allows an existing SVG to be drawn directly onto it
|
52
|
-
# There's a *little* bit of documentation at:
|
53
|
-
# http://ruby-gnome2.sourceforge.jp/fr/hiki.cgi?Cairo%3A%3AContext#render_rsvg_handle
|
54
|
-
def load_librsvg
|
55
|
-
return if @context.respond_to? :render_svg_handle
|
56
|
-
|
57
|
-
begin
|
58
|
-
require 'rsvg2'
|
59
|
-
rescue LoadError
|
60
|
-
raise LoadError, 'Ruby/RSVG library not found. Visit http://ruby-gnome2.sourceforge.jp/'
|
61
|
-
end
|
62
|
-
end
|
63
|
-
end
|
64
|
-
end
|
data/specs/load_spec.rb
DELETED
@@ -1,33 +0,0 @@
|
|
1
|
-
# coding: utf-8
|
2
|
-
|
3
|
-
puts $LOAD_PATH.inspect
|
4
|
-
require 'spec_helper'
|
5
|
-
|
6
|
-
context "The PDF::Wrapper class" do
|
7
|
-
|
8
|
-
before(:each) { create_pdf }
|
9
|
-
|
10
|
-
specify "should load external libs correctly" do
|
11
|
-
# lib gdkpixbuf
|
12
|
-
::Object.const_defined?(:Gdk).should eql(false)
|
13
|
-
@pdf.load_libpixbuf
|
14
|
-
::Object.const_defined?(:Gdk).should eql(true)
|
15
|
-
::Gdk.const_defined?(:Pixbuf).should eql(true)
|
16
|
-
|
17
|
-
# pango
|
18
|
-
::Object.const_defined?(:Pango).should eql(false)
|
19
|
-
@pdf.load_libpango
|
20
|
-
::Object.const_defined?(:Pango).should eql(true)
|
21
|
-
|
22
|
-
# libpoppler
|
23
|
-
::Object.const_defined?(:Poppler).should eql(false)
|
24
|
-
@pdf.load_libpoppler
|
25
|
-
::Object.const_defined?(:Poppler).should eql(true)
|
26
|
-
|
27
|
-
# librsvg
|
28
|
-
::Object.const_defined?(:RSVG).should eql(false)
|
29
|
-
@pdf.load_librsvg
|
30
|
-
::Object.const_defined?(:RSVG).should eql(true)
|
31
|
-
|
32
|
-
end
|
33
|
-
end
|