pdf-core 0.2.1 → 0.2.2
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/pdf/core.rb +2 -0
 - data/lib/pdf/core/outline_item.rb +27 -0
 - data/lib/pdf/core/outline_root.rb +15 -0
 - metadata +3 -1
 
    
        checksums.yaml
    CHANGED
    
    | 
         @@ -1,7 +1,7 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            ---
         
     | 
| 
       2 
2 
     | 
    
         
             
            SHA1:
         
     | 
| 
       3 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       4 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 3 
     | 
    
         
            +
              metadata.gz: f469bdd1670c6f5ec89826642d68516ca5b543ae
         
     | 
| 
      
 4 
     | 
    
         
            +
              data.tar.gz: 63dd4c8eba7388b044cba1748184e61b0e34392f
         
     | 
| 
       5 
5 
     | 
    
         
             
            SHA512:
         
     | 
| 
       6 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       7 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 6 
     | 
    
         
            +
              metadata.gz: bef5eb805c93a52f3e3ceadb497f537adfcd5c2b27171462bcbf78d8e1d068a11c34e18cd8d5f985de5943fc73cda791fa72738a7cf30a550f6ed1d072c5c9e2
         
     | 
| 
      
 7 
     | 
    
         
            +
              data.tar.gz: d7cbcbbc546f6007277049abcfddc7da1f8fa16f0ebadc28627303ed791202f27ea04a211af03c71361614847c105fe660055e50f0be54e99f11824a121595ce
         
     | 
    
        data/lib/pdf/core.rb
    CHANGED
    
    | 
         @@ -13,6 +13,8 @@ require_relative "core/document_state" 
     | 
|
| 
       13 
13 
     | 
    
         
             
            require_relative "core/name_tree"
         
     | 
| 
       14 
14 
     | 
    
         
             
            require_relative "core/graphics_state"
         
     | 
| 
       15 
15 
     | 
    
         
             
            require_relative "core/page_geometry"
         
     | 
| 
      
 16 
     | 
    
         
            +
            require_relative "core/outline_root"
         
     | 
| 
      
 17 
     | 
    
         
            +
            require_relative "core/outline_item"
         
     | 
| 
       16 
18 
     | 
    
         | 
| 
       17 
19 
     | 
    
         
             
            module PDF
         
     | 
| 
       18 
20 
     | 
    
         
             
              module Core
         
     | 
| 
         @@ -0,0 +1,27 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            module PDF
         
     | 
| 
      
 2 
     | 
    
         
            +
              module Core
         
     | 
| 
      
 3 
     | 
    
         
            +
                class OutlineItem #:nodoc:
         
     | 
| 
      
 4 
     | 
    
         
            +
                  attr_accessor :count, :first, :last, :next, :prev, :parent, :title, :dest, :closed
         
     | 
| 
      
 5 
     | 
    
         
            +
             
     | 
| 
      
 6 
     | 
    
         
            +
                  def initialize(title, parent, options)
         
     | 
| 
      
 7 
     | 
    
         
            +
                    @closed = options[:closed]
         
     | 
| 
      
 8 
     | 
    
         
            +
                    @title = title
         
     | 
| 
      
 9 
     | 
    
         
            +
                    @parent = parent
         
     | 
| 
      
 10 
     | 
    
         
            +
                    @count = 0
         
     | 
| 
      
 11 
     | 
    
         
            +
                  end
         
     | 
| 
      
 12 
     | 
    
         
            +
             
     | 
| 
      
 13 
     | 
    
         
            +
                  def to_hash
         
     | 
| 
      
 14 
     | 
    
         
            +
                    hash = { :Title => title,
         
     | 
| 
      
 15 
     | 
    
         
            +
                             :Parent => parent,
         
     | 
| 
      
 16 
     | 
    
         
            +
                             :Count => closed ? -count : count }
         
     | 
| 
      
 17 
     | 
    
         
            +
                    [{:First => first}, {:Last => last}, {:Next => defined?(@next) && @next},
         
     | 
| 
      
 18 
     | 
    
         
            +
                     {:Prev => prev}, {:Dest => dest}].each do |h|
         
     | 
| 
      
 19 
     | 
    
         
            +
                      unless h.values.first.nil?
         
     | 
| 
      
 20 
     | 
    
         
            +
                        hash.merge!(h)
         
     | 
| 
      
 21 
     | 
    
         
            +
                      end
         
     | 
| 
      
 22 
     | 
    
         
            +
                    end
         
     | 
| 
      
 23 
     | 
    
         
            +
                    hash
         
     | 
| 
      
 24 
     | 
    
         
            +
                  end
         
     | 
| 
      
 25 
     | 
    
         
            +
                end
         
     | 
| 
      
 26 
     | 
    
         
            +
              end
         
     | 
| 
      
 27 
     | 
    
         
            +
            end
         
     | 
    
        metadata
    CHANGED
    
    | 
         @@ -1,7 +1,7 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            --- !ruby/object:Gem::Specification
         
     | 
| 
       2 
2 
     | 
    
         
             
            name: pdf-core
         
     | 
| 
       3 
3 
     | 
    
         
             
            version: !ruby/object:Gem::Version
         
     | 
| 
       4 
     | 
    
         
            -
              version: 0.2. 
     | 
| 
      
 4 
     | 
    
         
            +
              version: 0.2.2
         
     | 
| 
       5 
5 
     | 
    
         
             
            platform: ruby
         
     | 
| 
       6 
6 
     | 
    
         
             
            authors:
         
     | 
| 
       7 
7 
     | 
    
         
             
            - Gregory Brown
         
     | 
| 
         @@ -106,6 +106,8 @@ files: 
     | 
|
| 
       106 
106 
     | 
    
         
             
            - lib/pdf/core/literal_string.rb
         
     | 
| 
       107 
107 
     | 
    
         
             
            - lib/pdf/core/name_tree.rb
         
     | 
| 
       108 
108 
     | 
    
         
             
            - lib/pdf/core/object_store.rb
         
     | 
| 
      
 109 
     | 
    
         
            +
            - lib/pdf/core/outline_item.rb
         
     | 
| 
      
 110 
     | 
    
         
            +
            - lib/pdf/core/outline_root.rb
         
     | 
| 
       109 
111 
     | 
    
         
             
            - lib/pdf/core/page.rb
         
     | 
| 
       110 
112 
     | 
    
         
             
            - lib/pdf/core/page_geometry.rb
         
     | 
| 
       111 
113 
     | 
    
         
             
            - lib/pdf/core/pdf_object.rb
         
     |