onlyoffice_pdf_parser 0.4.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)
|
@@ -108,7 +107,9 @@ module OnlyofficePdfParser
|
|
108
107
|
def fetch_pixels
|
109
108
|
tmp_file = Tempfile.new('onlyoffice_pdf_parser')
|
110
109
|
File.binwrite(tmp_file, data)
|
111
|
-
@pixels = ImageList.new(tmp_file.path)
|
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,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2022-
|
12
|
+
date: 2022-10-10 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: image_size
|
@@ -49,16 +49,22 @@ dependencies:
|
|
49
49
|
name: rmagick
|
50
50
|
requirement: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
|
-
- - "
|
52
|
+
- - ">="
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '4'
|
55
|
+
- - "<"
|
56
|
+
- !ruby/object:Gem::Version
|
57
|
+
version: '6'
|
55
58
|
type: :runtime
|
56
59
|
prerelease: false
|
57
60
|
version_requirements: !ruby/object:Gem::Requirement
|
58
61
|
requirements:
|
59
|
-
- - "
|
62
|
+
- - ">="
|
60
63
|
- !ruby/object:Gem::Version
|
61
64
|
version: '4'
|
65
|
+
- - "<"
|
66
|
+
- !ruby/object:Gem::Version
|
67
|
+
version: '6'
|
62
68
|
- !ruby/object:Gem::Dependency
|
63
69
|
name: overcommit
|
64
70
|
requirement: !ruby/object:Gem::Requirement
|
@@ -235,14 +241,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
235
241
|
requirements:
|
236
242
|
- - ">="
|
237
243
|
- !ruby/object:Gem::Version
|
238
|
-
version: '2.
|
244
|
+
version: '2.6'
|
239
245
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
240
246
|
requirements:
|
241
247
|
- - ">="
|
242
248
|
- !ruby/object:Gem::Version
|
243
249
|
version: '0'
|
244
250
|
requirements: []
|
245
|
-
rubygems_version: 3.3.
|
251
|
+
rubygems_version: 3.3.7
|
246
252
|
signing_key:
|
247
253
|
specification_version: 4
|
248
254
|
summary: ONLYOFFICE PDF Parser Gem
|