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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 214a429acbb26d39087be7eaf5df268a5f5b072d
4
- data.tar.gz: dcc45ccaf9206b5d2e85922ac9019eb3a23f3bde
3
+ metadata.gz: f469bdd1670c6f5ec89826642d68516ca5b543ae
4
+ data.tar.gz: 63dd4c8eba7388b044cba1748184e61b0e34392f
5
5
  SHA512:
6
- metadata.gz: ec4be03057a7332b0e92b74b18826140afa8ab5faaafd94d52c009aecab3cda187a59f9d70fc0a36c2f95de071c95f1c49f958ec7bf9c93d779b3f313eca3e61
7
- data.tar.gz: a548742fc3a1b06836540855cc832278e10a7dec1bc6ebe56af827894babd59cfe1a2dd36ad6c0c355aa57d60355d0ae6dc0a3c2dd34aae41343532df0b0944e
6
+ metadata.gz: bef5eb805c93a52f3e3ceadb497f537adfcd5c2b27171462bcbf78d8e1d068a11c34e18cd8d5f985de5943fc73cda791fa72738a7cf30a550f6ed1d072c5c9e2
7
+ data.tar.gz: d7cbcbbc546f6007277049abcfddc7da1f8fa16f0ebadc28627303ed791202f27ea04a211af03c71361614847c105fe660055e50f0be54e99f11824a121595ce
@@ -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
@@ -0,0 +1,15 @@
1
+ module PDF
2
+ module Core
3
+ class OutlineRoot #:nodoc:
4
+ attr_accessor :count, :first, :last
5
+
6
+ def initialize
7
+ @count = 0
8
+ end
9
+
10
+ def to_hash
11
+ {:Type => :Outlines, :Count => count, :First => first, :Last => last}
12
+ end
13
+ end
14
+ end
15
+ 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.1
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