onlyoffice_pdf_parser 0.3.0 → 0.5.0
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: afe6bc6beb5b689e3e74b6917d452004775197b716394e6c75d379468ee970b4
|
4
|
+
data.tar.gz: a4a0928fe36eeb98a5032f8acda836cb37e4217dac3dd0a759cecee352908a1d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cbe234313126d9b7728ae1ea2ebf1e4824feaaa589775f701b1caaf4e75626fbce6ef8ea66c748fbba38170de4330f5c02458263fbad69e86db922287f034471
|
7
|
+
data.tar.gz: '0603019b80a5204e5b0b9d7277bb24344851b5788a8d94afba3fa6f56eacf34d73e4521598c3692a9d93a964ca843c4dd3e24a9ce0d24946276793d4a0ea86d7'
|
@@ -8,7 +8,6 @@ require_relative 'helpers/cursor_point'
|
|
8
8
|
module OnlyofficePdfParser
|
9
9
|
# class for storing bmp image pixels data
|
10
10
|
class BmpImage
|
11
|
-
include Magick
|
12
11
|
attr_accessor :path_to_image, :pixels, :width, :height
|
13
12
|
# @return [String] binary dat of file
|
14
13
|
attr_reader :data
|
@@ -92,7 +91,7 @@ module OnlyofficePdfParser
|
|
92
91
|
|
93
92
|
private
|
94
93
|
|
95
|
-
# @param param [String] file path of file
|
94
|
+
# @param param [String] file path of file binary data
|
96
95
|
# @return [Void] init class data
|
97
96
|
def init_data(param)
|
98
97
|
if OnlyofficePdfParser::FileHelper.file_path?(param)
|
@@ -107,8 +106,10 @@ module OnlyofficePdfParser
|
|
107
106
|
# @return [Void] Fill @pixel with data
|
108
107
|
def fetch_pixels
|
109
108
|
tmp_file = Tempfile.new('onlyoffice_pdf_parser')
|
110
|
-
File.
|
111
|
-
@pixels = ImageList.new(tmp_file.path)
|
109
|
+
File.binwrite(tmp_file, data)
|
110
|
+
@pixels = Magick::ImageList.new(tmp_file.path)
|
111
|
+
.get_pixels(0, 0, width, height)
|
112
|
+
.each_slice(width).to_a
|
112
113
|
tmp_file.unlink
|
113
114
|
end
|
114
115
|
|
@@ -14,8 +14,8 @@ module PdfConvertToBmpHelper
|
|
14
14
|
|
15
15
|
private
|
16
16
|
|
17
|
-
# @param path_pattern [String] pattern to find
|
18
|
-
# @return [Array<String>] list of
|
17
|
+
# @param path_pattern [String] pattern to find BMPs
|
18
|
+
# @return [Array<String>] list of BMPs
|
19
19
|
def multipage_files(path_pattern)
|
20
20
|
files_dir = File.dirname(path_pattern)
|
21
21
|
files_base = File.basename(path_pattern, '.*')
|
@@ -15,7 +15,7 @@ module OnlyofficePdfParser
|
|
15
15
|
attr_accessor :pages
|
16
16
|
# @return [String] full path to file
|
17
17
|
attr_accessor :file_path
|
18
|
-
# @return [Array<String>] bin representation of
|
18
|
+
# @return [Array<String>] bin representation of BMPs
|
19
19
|
attr_reader :pages_in_bmp
|
20
20
|
|
21
21
|
def initialize(pages: [], file_path: nil)
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: onlyoffice_pdf_parser
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Pavel Lobashov
|
@@ -9,22 +9,28 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2022-10-10 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: image_size
|
16
16
|
requirement: !ruby/object:Gem::Requirement
|
17
17
|
requirements:
|
18
|
-
- - "
|
18
|
+
- - ">="
|
19
19
|
- !ruby/object:Gem::Version
|
20
20
|
version: '2'
|
21
|
+
- - "<"
|
22
|
+
- !ruby/object:Gem::Version
|
23
|
+
version: '4'
|
21
24
|
type: :runtime
|
22
25
|
prerelease: false
|
23
26
|
version_requirements: !ruby/object:Gem::Requirement
|
24
27
|
requirements:
|
25
|
-
- - "
|
28
|
+
- - ">="
|
26
29
|
- !ruby/object:Gem::Version
|
27
30
|
version: '2'
|
31
|
+
- - "<"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '4'
|
28
34
|
- !ruby/object:Gem::Dependency
|
29
35
|
name: pdf-reader
|
30
36
|
requirement: !ruby/object:Gem::Requirement
|
@@ -43,16 +49,22 @@ dependencies:
|
|
43
49
|
name: rmagick
|
44
50
|
requirement: !ruby/object:Gem::Requirement
|
45
51
|
requirements:
|
46
|
-
- - "
|
52
|
+
- - ">="
|
47
53
|
- !ruby/object:Gem::Version
|
48
54
|
version: '4'
|
55
|
+
- - "<"
|
56
|
+
- !ruby/object:Gem::Version
|
57
|
+
version: '6'
|
49
58
|
type: :runtime
|
50
59
|
prerelease: false
|
51
60
|
version_requirements: !ruby/object:Gem::Requirement
|
52
61
|
requirements:
|
53
|
-
- - "
|
62
|
+
- - ">="
|
54
63
|
- !ruby/object:Gem::Version
|
55
64
|
version: '4'
|
65
|
+
- - "<"
|
66
|
+
- !ruby/object:Gem::Version
|
67
|
+
version: '6'
|
56
68
|
- !ruby/object:Gem::Dependency
|
57
69
|
name: overcommit
|
58
70
|
requirement: !ruby/object:Gem::Requirement
|
@@ -220,6 +232,7 @@ metadata:
|
|
220
232
|
documentation_uri: https://www.rubydoc.info/gems/onlyoffice_pdf_parser
|
221
233
|
homepage_uri: https://github.com/ONLYOFFICE-QA/onlyoffice_pdf_parser
|
222
234
|
source_code_uri: https://github.com/ONLYOFFICE-QA/onlyoffice_pdf_parser
|
235
|
+
rubygems_mfa_required: 'true'
|
223
236
|
post_install_message:
|
224
237
|
rdoc_options: []
|
225
238
|
require_paths:
|
@@ -228,14 +241,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
228
241
|
requirements:
|
229
242
|
- - ">="
|
230
243
|
- !ruby/object:Gem::Version
|
231
|
-
version: '2.
|
244
|
+
version: '2.6'
|
232
245
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
233
246
|
requirements:
|
234
247
|
- - ">="
|
235
248
|
- !ruby/object:Gem::Version
|
236
249
|
version: '0'
|
237
250
|
requirements: []
|
238
|
-
rubygems_version: 3.
|
251
|
+
rubygems_version: 3.3.7
|
239
252
|
signing_key:
|
240
253
|
specification_version: 4
|
241
254
|
summary: ONLYOFFICE PDF Parser Gem
|