hexapdf 0.15.3 → 0.15.4

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: 592ea8ae7648df43e92ba50effdf3f8f34163e4acf7fb9567c3b38db46eb598e
4
- data.tar.gz: 6c3b7d32a1499f2e2133fbafdf46b9d3cd4d1df41b9ae308c0c32ea39aefff2d
3
+ metadata.gz: 6901d1281fa7f0585e2fe02b27985c9b7ff26770015902566c72ea62f5398e10
4
+ data.tar.gz: 4b1a82d17d4d1144b47dbb713552bb5e977896b94210a54c7b83871399d393ac
5
5
  SHA512:
6
- metadata.gz: fdf9edf53c0443d459008634ddbff7cd80fc1422fa558df41db04af0d9eeb512ea050d5b4a10987b824c675203e39bc851d1b2a68d0178f2cd12fada66b31245
7
- data.tar.gz: 8e6a7b91da0ed2b63f7bc6d52c3993553f439edf986253b3508d0510310195c2a6f3721c2cfed735afc3d60dacacedc8207a6fac361bedc354bc6bd779207eac
6
+ metadata.gz: 1d4acb6e9f867195e998b3fd900102013a8d4b74c576f3c3243225a515bbcf2be8b62852db95cbcd9213ec06334b174fba4db406dfb8e228083d9a527eb8a5a1
7
+ data.tar.gz: 3306a678655f59c35b3349cd247606ca7e45a34e033dd9b9b3bad33c20a3fda95ba07bff88acdb7c5666c23b1ab63d293963e68db7e12371c56106645df7d9bb
data/CHANGELOG.md CHANGED
@@ -1,3 +1,11 @@
1
+ ## 0.15.4 - 2021-05-27
2
+
3
+ ### Fixed
4
+
5
+ * [HexaPDF::Type::Annotation#appearance] to handle cases where there is
6
+ no valid appearance stream
7
+
8
+
1
9
  ## 0.15.3 - 2021-05-01
2
10
 
3
11
  ### Fixed
@@ -138,8 +138,13 @@ module HexaPDF
138
138
  if entry.kind_of?(HexaPDF::Dictionary) && !entry.kind_of?(HexaPDF::Stream)
139
139
  entry = entry[self[:AS]]
140
140
  end
141
- if entry.kind_of?(HexaPDF::Stream)
142
- entry[:Subtype] == :Form ? entry : document.wrap(entry, type: :XObject, subtype: :Form)
141
+ return unless entry.kind_of?(HexaPDF::Stream)
142
+
143
+ if entry.type == :XObject && entry[:Subtype] == :Form
144
+ entry
145
+ elsif (entry[:Type].nil? || entry[:Type] == :XObject) &&
146
+ (entry[:Subtype].nil? || entry[:Subtype] == :Form) && entry[:BBox]
147
+ document.wrap(entry, type: :XObject, subtype: :Form)
143
148
  end
144
149
  end
145
150
  alias appearance? appearance
@@ -37,6 +37,6 @@
37
37
  module HexaPDF
38
38
 
39
39
  # The version of HexaPDF.
40
- VERSION = '0.15.3'
40
+ VERSION = '0.15.4'
41
41
 
42
42
  end
@@ -40,7 +40,7 @@ describe HexaPDF::Writer do
40
40
  219
41
41
  %%EOF
42
42
  3 0 obj
43
- <</Producer(HexaPDF version 0.15.3)>>
43
+ <</Producer(HexaPDF version 0.15.4)>>
44
44
  endobj
45
45
  xref
46
46
  3 1
@@ -72,7 +72,7 @@ describe HexaPDF::Writer do
72
72
  141
73
73
  %%EOF
74
74
  6 0 obj
75
- <</Producer(HexaPDF version 0.15.3)>>
75
+ <</Producer(HexaPDF version 0.15.4)>>
76
76
  endobj
77
77
  2 0 obj
78
78
  <</Length 10>>stream
@@ -51,14 +51,18 @@ describe HexaPDF::Type::Annotation do
51
51
 
52
52
  stream = @doc.wrap({}, stream: '')
53
53
  @annot[:AP][:N] = stream
54
+ assert_nil(@annot.appearance)
55
+
56
+ stream[:BBox] = [1, 2, 3, 4]
54
57
  appearance = @annot.appearance
55
58
  assert_same(stream.data, appearance.data)
56
59
  assert_equal(:Form, appearance[:Subtype])
57
60
 
58
- @annot[:AP][:N] = {X: stream}
61
+ @annot[:AP][:N] = {X: {}}
59
62
  assert_nil(@annot.appearance)
60
63
 
61
64
  @annot[:AS] = :X
65
+ @annot[:AP][:N][:X] = stream
62
66
  assert_same(stream.data, @annot.appearance.data)
63
67
 
64
68
  @annot[:AP][:D] = {X: stream}
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hexapdf
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.15.3
4
+ version: 0.15.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Thomas Leitner
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-05-01 00:00:00.000000000 Z
11
+ date: 2021-05-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: cmdparse