hexapdf 0.15.3 → 0.15.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/CHANGELOG.md +8 -0
 - data/lib/hexapdf/type/annotation.rb +7 -2
 - data/lib/hexapdf/version.rb +1 -1
 - data/test/hexapdf/test_writer.rb +2 -2
 - data/test/hexapdf/type/test_annotation.rb +5 -1
 - metadata +2 -2
 
    
        checksums.yaml
    CHANGED
    
    | 
         @@ -1,7 +1,7 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            ---
         
     | 
| 
       2 
2 
     | 
    
         
             
            SHA256:
         
     | 
| 
       3 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       4 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 3 
     | 
    
         
            +
              metadata.gz: 6901d1281fa7f0585e2fe02b27985c9b7ff26770015902566c72ea62f5398e10
         
     | 
| 
      
 4 
     | 
    
         
            +
              data.tar.gz: 4b1a82d17d4d1144b47dbb713552bb5e977896b94210a54c7b83871399d393ac
         
     | 
| 
       5 
5 
     | 
    
         
             
            SHA512:
         
     | 
| 
       6 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       7 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 6 
     | 
    
         
            +
              metadata.gz: 1d4acb6e9f867195e998b3fd900102013a8d4b74c576f3c3243225a515bbcf2be8b62852db95cbcd9213ec06334b174fba4db406dfb8e228083d9a527eb8a5a1
         
     | 
| 
      
 7 
     | 
    
         
            +
              data.tar.gz: 3306a678655f59c35b3349cd247606ca7e45a34e033dd9b9b3bad33c20a3fda95ba07bff88acdb7c5666c23b1ab63d293963e68db7e12371c56106645df7d9bb
         
     | 
    
        data/CHANGELOG.md
    CHANGED
    
    
| 
         @@ -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 
     | 
    
         
            -
                     
     | 
| 
       142 
     | 
    
         
            -
             
     | 
| 
      
 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
         
     | 
    
        data/lib/hexapdf/version.rb
    CHANGED
    
    
    
        data/test/hexapdf/test_writer.rb
    CHANGED
    
    | 
         @@ -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. 
     | 
| 
      
 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. 
     | 
| 
      
 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:  
     | 
| 
      
 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. 
     | 
| 
      
 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- 
     | 
| 
      
 11 
     | 
    
         
            +
            date: 2021-05-27 00:00:00.000000000 Z
         
     | 
| 
       12 
12 
     | 
    
         
             
            dependencies:
         
     | 
| 
       13 
13 
     | 
    
         
             
            - !ruby/object:Gem::Dependency
         
     | 
| 
       14 
14 
     | 
    
         
             
              name: cmdparse
         
     |