poppler 3.5.0 → 4.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/poppler/document.rb +9 -12
- data/test/test-document.rb +19 -7
- metadata +9 -9
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d97ca6c8acd9656993c3037045300e00eab93c11fc34acacf7f10b663f904da8
|
4
|
+
data.tar.gz: 38243b6585f110d6b782efd839bcd55d16b41a3d43ca3640f10a8b2f6aa427e9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6d809f5aea68aa39b26f43f0d0bf810c45590d9da6784cbeaf12485276a55d9111b7be9b532d66adf2b337a6f9604d2acf261b4a6b4da5e7c48765af155d9f90
|
7
|
+
data.tar.gz: a08dbc6304f0cfd0bed7b417cd845e03c489ba9b5e2d495f3e85dfddbf260041a7fd1ea252f27aab4201a9fecf2fd4378ea988a5444da5e80b3db5f7ac0b39c8
|
data/lib/poppler/document.rb
CHANGED
@@ -48,18 +48,15 @@ module Poppler
|
|
48
48
|
password = options[:password]
|
49
49
|
|
50
50
|
if data
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
@file.write(data)
|
61
|
-
@file.close
|
62
|
-
initialize_new_from_file(ensure_uri(@file.path), password)
|
51
|
+
if respond_to?(:initialize_new_from_bytes)
|
52
|
+
initialize_new_from_bytes(data, password)
|
53
|
+
else
|
54
|
+
@file = Tempfile.new(["poppler", ".pdf"])
|
55
|
+
@file.binmode
|
56
|
+
@file.write(data)
|
57
|
+
@file.close
|
58
|
+
initialize_new_from_file(ensure_uri(@file.path), password)
|
59
|
+
end
|
63
60
|
elsif uri
|
64
61
|
initialize_new_from_file(uri, password)
|
65
62
|
elsif path
|
data/test/test-document.rb
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# Copyright (C) 2008-
|
1
|
+
# Copyright (C) 2008-2022 Ruby-GNOME Project Team
|
2
2
|
#
|
3
3
|
# This library is free software; you can redistribute it and/or
|
4
4
|
# modify it under the terms of the GNU Lesser General Public
|
@@ -32,15 +32,27 @@ class TestDocument < Test::Unit::TestCase
|
|
32
32
|
end
|
33
33
|
end
|
34
34
|
|
35
|
-
def
|
35
|
+
def setup
|
36
36
|
pdf = StringIO.new("".b)
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
37
|
+
Cairo::PDFSurface.create(pdf, 100, 100) do |surface|
|
38
|
+
Cairo::Context.create(surface) do |context|
|
39
|
+
context.show_text("Hello")
|
40
|
+
end
|
41
|
+
end
|
42
|
+
@pdf_data = pdf.string.freeze
|
43
|
+
end
|
44
|
+
|
45
|
+
def test_default_internal
|
46
|
+
document = with_default_internal(Encoding::UTF_8) do
|
47
|
+
Poppler::Document.new(data: @pdf_data)
|
48
|
+
end
|
49
|
+
assert_equal("Hello", document[0].text)
|
50
|
+
end
|
41
51
|
|
52
|
+
def test_glib_bytes
|
53
|
+
only_poppler_version(0, 82, 0)
|
42
54
|
document = with_default_internal(Encoding::UTF_8) do
|
43
|
-
Poppler::Document.new(:
|
55
|
+
Poppler::Document.new(data: GLib::Bytes.new(@pdf_data))
|
44
56
|
end
|
45
57
|
assert_equal("Hello", document[0].text)
|
46
58
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: poppler
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 4.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- The Ruby-GNOME Project Team
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-01
|
11
|
+
date: 2022-09-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: cairo-gobject
|
@@ -16,28 +16,28 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - '='
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version:
|
19
|
+
version: 4.0.1
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - '='
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version:
|
26
|
+
version: 4.0.1
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: gio2
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
31
|
- - '='
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version:
|
33
|
+
version: 4.0.1
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - '='
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version:
|
40
|
+
version: 4.0.1
|
41
41
|
description: Ruby/Poppler is a Ruby binding of poppler-glib.
|
42
42
|
email: ruby-gnome2-devel-en@lists.sourceforge.net
|
43
43
|
executables: []
|
@@ -92,7 +92,7 @@ licenses:
|
|
92
92
|
- LGPL-2.1+
|
93
93
|
metadata:
|
94
94
|
msys2_mingw_dependencies: poppler
|
95
|
-
post_install_message:
|
95
|
+
post_install_message:
|
96
96
|
rdoc_options: []
|
97
97
|
require_paths:
|
98
98
|
- lib
|
@@ -108,7 +108,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
108
108
|
version: '0'
|
109
109
|
requirements: []
|
110
110
|
rubygems_version: 3.4.0.dev
|
111
|
-
signing_key:
|
111
|
+
signing_key:
|
112
112
|
specification_version: 4
|
113
113
|
summary: Ruby/Poppler is a Ruby binding of poppler-glib.
|
114
114
|
test_files: []
|