mupdf 1.0.3 → 1.0.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.
- checksums.yaml +4 -4
- data/lib/mupdf/box.rb +16 -16
- data/lib/mupdf/page.rb +2 -2
- data/lib/mupdf/version.rb +1 -1
- data/lib/mupdf.rb +1 -0
- metadata +17 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3608937cd01b6b8c0d1fca5b0c6be8752f759c88401ed981759d22fce2f2bfa2
|
4
|
+
data.tar.gz: bc2f3f9fe2be26b9c141a865566ca8a264cd563cb30922bd418a8eae1706deb6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f7ad8f8b720cd13d53c1bdc1ec70e9c67a6cb3bdeedd7d999004bb379ca2de732aa6ced8c7d96bb1b7d232c32aa45593a478090c2ef07a181f8df0319dcaf33e
|
7
|
+
data.tar.gz: b6296bb3c59ae8a0c439e56ec68e0319ee9f84b806dc00ea9ccaef8f0584e8f89c9f6f8ac6b86ed194a8edd2597d92f229f6aeac6b004da90be98655eebc47c2
|
data/lib/mupdf/box.rb
CHANGED
@@ -3,26 +3,26 @@
|
|
3
3
|
module MuPDF
|
4
4
|
# A bounding box for a PDF (e.g. media / crop / bleed / trim).
|
5
5
|
class Box
|
6
|
-
REGEX = /l="(?<l>\d
|
6
|
+
REGEX = /l="(?<l>\d+.?\d*)" b="(?<b>\d+.?\d*)" r="(?<r>\d+.?\d*)" t="(?<t>\d+.?\d*)"/
|
7
7
|
|
8
8
|
# @!attribute l
|
9
|
-
# @return [
|
9
|
+
# @return [BigDecimal] The left coordinate.
|
10
10
|
attr_reader :l
|
11
11
|
|
12
12
|
# @!attribute b
|
13
|
-
# @return [
|
13
|
+
# @return [BigDecimal] The bottom coordinate.
|
14
14
|
attr_reader :b
|
15
15
|
|
16
16
|
# @!attribute r
|
17
|
-
# @return [
|
17
|
+
# @return [BigDecimal] The right coordinate.
|
18
18
|
attr_reader :r
|
19
19
|
|
20
20
|
# @!attribute t
|
21
|
-
# @return [
|
21
|
+
# @return [BigDecimal] The top coordinate.
|
22
22
|
attr_reader :t
|
23
23
|
|
24
24
|
# @!attribute kind
|
25
|
-
# @return [
|
25
|
+
# @return [BigDecimal] The kind of box.
|
26
26
|
attr_reader :kind
|
27
27
|
|
28
28
|
# @param text [String]
|
@@ -34,18 +34,18 @@ module MuPDF
|
|
34
34
|
return unless match
|
35
35
|
|
36
36
|
new(
|
37
|
-
l:
|
38
|
-
b:
|
39
|
-
r:
|
40
|
-
t:
|
37
|
+
l: BigDecimal(match[:l]),
|
38
|
+
b: BigDecimal(match[:b]),
|
39
|
+
r: BigDecimal(match[:r]),
|
40
|
+
t: BigDecimal(match[:t]),
|
41
41
|
kind:
|
42
42
|
)
|
43
43
|
end
|
44
44
|
|
45
|
-
# @param l [
|
46
|
-
# @param b [
|
47
|
-
# @param r [
|
48
|
-
# @param t [
|
45
|
+
# @param l [BigDecimal]
|
46
|
+
# @param b [BigDecimal]
|
47
|
+
# @param r [BigDecimal]
|
48
|
+
# @param t [BigDecimal]
|
49
49
|
# @param kind [Symbol] optional
|
50
50
|
def initialize(l:, b:, r:, t:, kind: nil)
|
51
51
|
@l = l
|
@@ -60,12 +60,12 @@ module MuPDF
|
|
60
60
|
"#<#{self.class.name} l=#{l} b=#{b} r=#{r} t=#{t} kind=#{kind}>"
|
61
61
|
end
|
62
62
|
|
63
|
-
# @return [
|
63
|
+
# @return [BigDecimal]
|
64
64
|
def width
|
65
65
|
@r - @l
|
66
66
|
end
|
67
67
|
|
68
|
-
# @return [
|
68
|
+
# @return [BigDecimal]
|
69
69
|
def height
|
70
70
|
@t - @b
|
71
71
|
end
|
data/lib/mupdf/page.rb
CHANGED
@@ -120,12 +120,12 @@ module MuPDF
|
|
120
120
|
"#<#{self.class.name} number=#{@number} width=#{width} height=#{height}>"
|
121
121
|
end
|
122
122
|
|
123
|
-
# @return [
|
123
|
+
# @return [BigDecimal, nil]
|
124
124
|
def width
|
125
125
|
@media_box&.width
|
126
126
|
end
|
127
127
|
|
128
|
-
# @return [
|
128
|
+
# @return [BigDecimal, nil]
|
129
129
|
def height
|
130
130
|
@media_box&.height
|
131
131
|
end
|
data/lib/mupdf/version.rb
CHANGED
data/lib/mupdf.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mupdf
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kevin Sylvestre
|
@@ -10,6 +10,20 @@ bindir: bin
|
|
10
10
|
cert_chain: []
|
11
11
|
date: 2025-02-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: bigdecimal
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ">="
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '0'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ">="
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '0'
|
13
27
|
- !ruby/object:Gem::Dependency
|
14
28
|
name: open3
|
15
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -62,8 +76,8 @@ licenses:
|
|
62
76
|
metadata:
|
63
77
|
rubygems_mfa_required: 'true'
|
64
78
|
homepage_uri: https://github.com/ksylvest/mupdf
|
65
|
-
source_code_uri: https://github.com/ksylvest/mupdf/tree/v1.0.
|
66
|
-
changelog_uri: https://github.com/ksylvest/mupdf/releases/tag/v1.0.
|
79
|
+
source_code_uri: https://github.com/ksylvest/mupdf/tree/v1.0.4
|
80
|
+
changelog_uri: https://github.com/ksylvest/mupdf/releases/tag/v1.0.4
|
67
81
|
documentation_uri: https://mupdf.ksylvest.com/
|
68
82
|
post_install_message:
|
69
83
|
rdoc_options: []
|