pdf-wrapper 0.3.2 → 0.3.3
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG +3 -0
- data/Rakefile +1 -1
- data/lib/pdf/wrapper/loading.rb +18 -6
- metadata +4 -4
data/CHANGELOG
CHANGED
data/Rakefile
CHANGED
data/lib/pdf/wrapper/loading.rb
CHANGED
@@ -5,8 +5,10 @@ module PDF
|
|
5
5
|
# its own classes and constants. A small amount of documentation is available at
|
6
6
|
# http://ruby-gnome2.sourceforge.jp/fr/hiki.cgi?Cairo%3A%3AContext#Pango+related+APIs
|
7
7
|
def load_libpango
|
8
|
+
return if @context.respond_to? :create_pango_layout
|
9
|
+
|
8
10
|
begin
|
9
|
-
require 'pango'
|
11
|
+
require 'pango'
|
10
12
|
rescue LoadError
|
11
13
|
raise LoadError, 'Ruby/Pango library not found. Visit http://ruby-gnome2.sourceforge.jp/'
|
12
14
|
end
|
@@ -16,8 +18,10 @@ module PDF
|
|
16
18
|
# This will add some methods to the cairo Context class in addition to providing
|
17
19
|
# its own classes and constants.
|
18
20
|
def load_libpixbuf
|
21
|
+
return if @context.respond_to? :set_source_pixbuf
|
22
|
+
|
19
23
|
begin
|
20
|
-
require 'gdk_pixbuf2'
|
24
|
+
require 'gdk_pixbuf2'
|
21
25
|
rescue LoadError
|
22
26
|
raise LoadError, 'Ruby/GdkPixbuf library not found. Visit http://ruby-gnome2.sourceforge.jp/'
|
23
27
|
end
|
@@ -27,8 +31,16 @@ module PDF
|
|
27
31
|
# This will add some methods to the cairo Context class in addition to providing
|
28
32
|
# its own classes and constants.
|
29
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
|
30
42
|
begin
|
31
|
-
require 'poppler'
|
43
|
+
require 'poppler'
|
32
44
|
rescue LoadError
|
33
45
|
raise LoadError, 'Ruby/Poppler library not found. Visit http://ruby-gnome2.sourceforge.jp/'
|
34
46
|
end
|
@@ -40,13 +52,13 @@ module PDF
|
|
40
52
|
# There's a *little* bit of documentation at:
|
41
53
|
# http://ruby-gnome2.sourceforge.jp/fr/hiki.cgi?Cairo%3A%3AContext#render_rsvg_handle
|
42
54
|
def load_librsvg
|
55
|
+
return if @context.respond_to? :render_svg_handle
|
56
|
+
|
43
57
|
begin
|
44
|
-
require 'rsvg2'
|
58
|
+
require 'rsvg2'
|
45
59
|
rescue LoadError
|
46
60
|
raise LoadError, 'Ruby/RSVG library not found. Visit http://ruby-gnome2.sourceforge.jp/'
|
47
61
|
end
|
48
62
|
end
|
49
|
-
|
50
|
-
|
51
63
|
end
|
52
64
|
end
|
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: 21
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 3
|
9
|
-
-
|
10
|
-
version: 0.3.
|
9
|
+
- 3
|
10
|
+
version: 0.3.3
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- James Healy
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2010-09-
|
18
|
+
date: 2010-09-07 00:00:00 +10:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|